Skip to content

Commit

Permalink
Release #1 and #2 (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
hideakikondo authored Feb 1, 2017
1 parent 376a521 commit e70d6c6
Show file tree
Hide file tree
Showing 826 changed files with 15,442 additions and 15,147 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
.settings/
bin/target/
target
/src/main/resources/dc-config.properties
/src/main/resources/personium-unit-config.properties
2 changes: 1 addition & 1 deletion checkstyle-suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<suppressions>
<suppress checks="." files="net[\\/]oauth[\\/]"/>
<suppress checks="Header" files="com[\\/]fujitsu[\\/]dc[\\/]core[\\/]odata[\\/]Dc.*\.java"/>
<suppress checks="Header" files="io[\\/]personium[\\/]core[\\/]odata[\\/]Personium.*\.java"/>
<suppress checks="MethodName" files=".*Test\.java"/>
<suppress checks="MagicNumber" files=".*Test\.java"/>
<suppress checks="JavadocPackage" files="[\\/]test[\\/]"/>
Expand Down
6 changes: 3 additions & 3 deletions findbugs-exclude.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<FindBugsFilter>
<Match class="com.fujitsu.dc.core.model.jaxb.ObjectFactory">
<Match class="io.personium.core.model.jaxb.ObjectFactory">
<BugCode name="Nm" />
</Match>
<Match class="com.fujitsu.dc.core.model.jaxb.Grant">
<Match class="io.personium.core.model.jaxb.Grant">
<BugCode name="UwF" />
</Match>
<Match class="com.fujitsu.dc.core.rs.cell.LogResource" method="getLog">
<Match class="io.personium.core.rs.cell.LogResource" method="getLog">
<BugCode name="OBL" />
</Match>
</FindBugsFilter>
File renamed without changes.
20 changes: 9 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<artifactId>personium-core</artifactId>
<packaging>war</packaging>
<version>1.4.2-SNAPSHOT</version>
<name>personiu-core Maven Webapp</name>
<name>personium-core Maven Webapp</name>
<url>http://maven.apache.org</url>
<licenses>
<license>
Expand All @@ -20,25 +20,23 @@
<java.target.version>1.8</java.target.version>
<logback.version>1.0.12</logback.version>
<slf4j.version>1.7.6</slf4j.version>
<jacoco.include.package>com.fujitsu.*</jacoco.include.package>
<!-- <jacoco.include.package>io.personium.*</jacoco.include.package> -->
<jacoco.include.package>io.personium.*</jacoco.include.package>
</properties>

<dependencies>
<dependency>
<groupId>io.personium</groupId>
<artifactId>personium-lib-es-adaptor</artifactId>
<version>1.4.1</version>
<artifactId>personium-lib-es-adapter</artifactId>
<version>1.4.2</version>
</dependency>
<dependency>
<groupId>io.personium</groupId>
<artifactId>personium-lib-common</artifactId>
<version>1.4.1</version>
<version>1.4.2</version>
</dependency>
<dependency>
<groupId>io.personium</groupId>
<artifactId>personium-client-java</artifactId>
<version>1.4.1</version>
<version>1.4.2</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -372,13 +370,13 @@
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<configuration>
<header>../copyright.txt</header>
<header>copyright.txt</header>
<excludes>
<exclude>.checkstyle</exclude>
<exclude>checkstyle.header</exclude>
<exclude>checkstyle_maven.properties</exclude>
<exclude>checkstyle-suppressions.xml</exclude>
<exclude>dc-checks.xml</exclude>
<exclude>personium-checkstyle.xml</exclude>
<exclude>findbugs-exclude.xml</exclude>
<exclude>pom.xml</exclude>
<exclude>NOTICE.txt</exclude>
Expand Down Expand Up @@ -442,7 +440,7 @@
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<encoding>UTF-8</encoding>
<configLocation>dc-checks.xml</configLocation>
<configLocation>personium-checkstyle.xml</configLocation>
<propertiesLocation>checkstyle_maven.properties</propertiesLocation>
</configuration>
<reportSets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.fujitsu.dc.core;
package io.personium.core;

import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MediaType;
Expand All @@ -24,10 +24,10 @@
import org.apache.http.HttpStatus;
import org.json.simple.JSONObject;

import com.fujitsu.dc.core.DcCoreMessageUtils.Severity;
import com.fujitsu.dc.core.auth.OAuth2Helper.Error;
import com.fujitsu.dc.core.auth.OAuth2Helper.Key;
import com.fujitsu.dc.core.auth.OAuth2Helper.Scheme;
import io.personium.core.PersoniumCoreMessageUtils.Severity;
import io.personium.core.auth.OAuth2Helper.Error;
import io.personium.core.auth.OAuth2Helper.Key;
import io.personium.core.auth.OAuth2Helper.Scheme;

/**
* ログメッセージ作成クラス.
Expand All @@ -36,108 +36,108 @@
* @author naoki
*/
@SuppressWarnings("serial")
public final class DcCoreAuthnException extends DcCoreException {
public final class PersoniumCoreAuthnException extends PersoniumCoreException {

/**
* Grant-Typeの値が異常.
*/
public static final DcCoreAuthnException UNSUPPORTED_GRANT_TYPE =
public static final PersoniumCoreAuthnException UNSUPPORTED_GRANT_TYPE =
create("PR400-AN-0001", Error.UNSUPPORTED_GRANT_TYPE);
/**
* dc_targetの値異常.
* p_targetの値異常.
*/
public static final DcCoreAuthnException INVALID_TARGET = create("PR400-AN-0002", Error.INVALID_REQUEST);
public static final PersoniumCoreAuthnException INVALID_TARGET = create("PR400-AN-0002", Error.INVALID_REQUEST);
/**
* Client Sercret パースエラー.
* Client Secret パースエラー.
*/
public static final DcCoreAuthnException CLIENT_SERCRET_PARSE_ERROR = create("PR400-AN-0003", Error.INVALID_CLIENT);
public static final PersoniumCoreAuthnException CLIENT_SECRET_PARSE_ERROR = create("PR400-AN-0003", Error.INVALID_CLIENT);
/**
* Client Sercret 有効期限チェック.
* Client Secret 有効期限チェック.
*/
public static final DcCoreAuthnException CLIENT_SERCRET_EXPIRED = create("PR400-AN-0004", Error.INVALID_CLIENT);
public static final PersoniumCoreAuthnException CLIENT_SECRET_EXPIRED = create("PR400-AN-0004", Error.INVALID_CLIENT);
/**
* Client Sercret 署名検証をエラー.
* Client Secret 署名検証をエラー.
*/
public static final DcCoreAuthnException CLIENT_SERCRET_DSIG_INVALID =
public static final PersoniumCoreAuthnException CLIENT_SECRET_DSIG_INVALID =
create("PR400-AN-0005", Error.INVALID_CLIENT);
/**
* Client Sercret のIssuerがIDと等しくない.
* Client Secret のIssuerがIDと等しくない.
*/
public static final DcCoreAuthnException CLIENT_SERCRET_ISSUER_MISMATCH =
public static final PersoniumCoreAuthnException CLIENT_SECRET_ISSUER_MISMATCH =
create("PR400-AN-0006", Error.INVALID_CLIENT);
/**
* Client Sercret のターゲットが自分でない.
* Client Secret のターゲットが自分でない.
*/
public static final DcCoreAuthnException CLIENT_SERCRET_TARGET_WRONG =
public static final PersoniumCoreAuthnException CLIENT_SECRET_TARGET_WRONG =
create("PR400-AN-0007", Error.INVALID_CLIENT);

/**
* トランスセルトークン認証ではユニットユーザ昇格はできない.
*/
public static final DcCoreAuthnException TC_ACCESS_REPRESENTING_OWNER =
public static final PersoniumCoreAuthnException TC_ACCESS_REPRESENTING_OWNER =
create("PR400-AN-0008", Error.INVALID_GRANT);
/**
* トークンパースエラー.
*/
public static final DcCoreAuthnException TOKEN_PARSE_ERROR = create("PR400-AN-0009", Error.INVALID_GRANT);
public static final PersoniumCoreAuthnException TOKEN_PARSE_ERROR = create("PR400-AN-0009", Error.INVALID_GRANT);
/**
* 有効期限切れ.
*/
public static final DcCoreAuthnException TOKEN_EXPIRED = create("PR400-AN-0010", Error.INVALID_GRANT);
public static final PersoniumCoreAuthnException TOKEN_EXPIRED = create("PR400-AN-0010", Error.INVALID_GRANT);
/**
* 署名検証をエラー.
*/
public static final DcCoreAuthnException TOKEN_DSIG_INVALID = create("PR400-AN-0011", Error.INVALID_GRANT);
public static final PersoniumCoreAuthnException TOKEN_DSIG_INVALID = create("PR400-AN-0011", Error.INVALID_GRANT);
/**
* トークン のターゲットが自分でない.
* {0}:トークンのターゲットURL
*/
public static final DcCoreAuthnException TOKEN_TARGET_WRONG = create("PR400-AN-0012", Error.INVALID_GRANT);
public static final PersoniumCoreAuthnException TOKEN_TARGET_WRONG = create("PR400-AN-0012", Error.INVALID_GRANT);
/**
* リフレッシュトークンでない.
*/
public static final DcCoreAuthnException NOT_REFRESH_TOKEN = create("PR400-AN-0013", Error.INVALID_GRANT);
public static final PersoniumCoreAuthnException NOT_REFRESH_TOKEN = create("PR400-AN-0013", Error.INVALID_GRANT);
/**
* 権限がないから昇格できない.
*/
public static final DcCoreAuthnException NOT_ALLOWED_REPRESENT_OWNER = create("PR400-AN-0014", Error.INVALID_GRANT);
public static final PersoniumCoreAuthnException NOT_ALLOWED_REPRESENT_OWNER = create("PR400-AN-0014", Error.INVALID_GRANT);
/**
* オーナーがいないセルは昇格できない.
*/
public static final DcCoreAuthnException NO_CELL_OWNER = create("PR400-AN-0015", Error.INVALID_GRANT);
public static final PersoniumCoreAuthnException NO_CELL_OWNER = create("PR400-AN-0015", Error.INVALID_GRANT);
/**
* 必須パラメータが無い.
* {0}:パラメータキー名
*/
public static final DcCoreAuthnException REQUIRED_PARAM_MISSING = create("PR400-AN-0016", Error.INVALID_REQUEST);
public static final PersoniumCoreAuthnException REQUIRED_PARAM_MISSING = create("PR400-AN-0016", Error.INVALID_REQUEST);
/**
* 認証エラー.
*/
public static final DcCoreAuthnException AUTHN_FAILED = create("PR400-AN-0017", Error.INVALID_GRANT);
public static final PersoniumCoreAuthnException AUTHN_FAILED = create("PR400-AN-0017", Error.INVALID_GRANT);
/**
* 認証ヘッダの指定誤り.
*/
public static final DcCoreAuthnException AUTH_HEADER_IS_INVALID = create("PR400-AN-0018", Error.INVALID_CLIENT);
public static final PersoniumCoreAuthnException AUTH_HEADER_IS_INVALID = create("PR400-AN-0018", Error.INVALID_CLIENT);
/**
* Accountロック中.
*/
public static final DcCoreAuthnException ACCOUNT_LOCK_ERROR = create("PR400-AN-0019", Error.INVALID_GRANT);
public static final PersoniumCoreAuthnException ACCOUNT_LOCK_ERROR = create("PR400-AN-0019", Error.INVALID_GRANT);
/**
* IDTokenの検証の中で、受け取ったIdTokenのAudienceが信頼するClientIDのリストに無かった.
*/
public static final DcCoreAuthnException OIDC_WRONG_AUDIENCE = create("PR400-AN-0030", Error.INVALID_GRANT);
public static final PersoniumCoreAuthnException OIDC_WRONG_AUDIENCE = create("PR400-AN-0030", Error.INVALID_GRANT);
/**
* OIDCの認証エラー.
*/
public static final DcCoreAuthnException OIDC_AUTHN_FAILED = create("PR400-AN-0031", Error.INVALID_GRANT);
public static final PersoniumCoreAuthnException OIDC_AUTHN_FAILED = create("PR400-AN-0031", Error.INVALID_GRANT);
/**
* 無効なIDToken.
*/
public static final DcCoreAuthnException OIDC_INVALID_ID_TOKEN = create("PR400-AN-0032", Error.INVALID_GRANT);
public static final PersoniumCoreAuthnException OIDC_INVALID_ID_TOKEN = create("PR400-AN-0032", Error.INVALID_GRANT);
/**
* IDTokenの有効期限切れ.
*/
public static final DcCoreAuthnException OIDC_EXPIRED_ID_TOKEN = create("PR400-AN-0033", Error.INVALID_GRANT);
public static final PersoniumCoreAuthnException OIDC_EXPIRED_ID_TOKEN = create("PR400-AN-0033", Error.INVALID_GRANT);

/**
* インナークラスを強制的にロードする.
Expand All @@ -157,7 +157,7 @@ public static void loadConfig() {
* @param error OAuth認証エラーのエラーコード
* @param realm WWWW-Authenticateヘッダを返す場合はここにrealm値を設定する
*/
DcCoreAuthnException(final String code,
PersoniumCoreAuthnException(final String code,
final Severity severity,
final String message,
final int status,
Expand All @@ -173,9 +173,9 @@ public static void loadConfig() {
* @param realm2set realm
* @return CoreAuthnException
*/
public DcCoreAuthnException realm(String realm2set) {
public PersoniumCoreAuthnException realm(String realm2set) {
// クローンを作成
return new DcCoreAuthnException(this.code, this.severity, this.message, this.status, this.error, realm2set);
return new PersoniumCoreAuthnException(this.code, this.severity, this.message, this.status, this.error, realm2set);
}

@SuppressWarnings("unchecked")
Expand Down Expand Up @@ -204,11 +204,11 @@ public Response createResponse() {
/**
* 原因例外を追加したものを作成して返します.
* @param t 原因例外
* @return DcCoreException
* @return PersoniumCoreException
*/
public DcCoreException reason(final Throwable t) {
public PersoniumCoreException reason(final Throwable t) {
// クローンを作成して
DcCoreException ret = new DcCoreAuthnException(
PersoniumCoreException ret = new PersoniumCoreAuthnException(
this.code, this.severity, this.message, this.status, this.error, this.realm);
// スタックトレースをセット
ret.setStackTrace(t.getStackTrace());
Expand All @@ -217,23 +217,23 @@ public DcCoreException reason(final Throwable t) {

/**
* ファクトリーメソッド.
* @param code DCメッセージコード
* @param code Personiumメッセージコード
* @param error OAuth2エラーコード
* @return DcCoreException
* @return PersoniumCoreException
*/
public static DcCoreAuthnException create(String code, String error) {
int statusCode = DcCoreException.parseCode(code);
public static PersoniumCoreAuthnException create(String code, String error) {
int statusCode = PersoniumCoreException.parseCode(code);

// ログレベルの取得
Severity severity = DcCoreMessageUtils.getSeverity(code);
Severity severity = PersoniumCoreMessageUtils.getSeverity(code);
if (severity == null) {
// ログレベルが設定されていなかったらレスポンスコードから自動的に判定する。
severity = decideSeverity(statusCode);
}

// ログメッセージの取得
String message = DcCoreMessageUtils.getMessage(code);
String message = PersoniumCoreMessageUtils.getMessage(code);

return new DcCoreAuthnException(code, severity, message, statusCode, error, null);
return new PersoniumCoreAuthnException(code, severity, message, statusCode, error, null);
}
}
Loading

0 comments on commit e70d6c6

Please sign in to comment.