Skip to content

Commit

Permalink
#69 jwt 규격에 맞는 네이밍으로 일괄 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
byplacebo committed Feb 24, 2017
1 parent a87983d commit 79ff414
Show file tree
Hide file tree
Showing 14 changed files with 265 additions and 277 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,8 @@
import com.skplanet.jose.JoseBuilders;
import com.skplanet.jose.JoseHeader;
import com.skplanet.jose.jwa.Jwa;
import com.skplanet.syruppay.token.claims.MapToSktUserConfigurer;
import com.skplanet.syruppay.token.claims.MapToSyrupPayUserConfigurer;
import com.skplanet.syruppay.token.claims.MerchantUserConfigurer;
import com.skplanet.syruppay.token.claims.OrderConfigurer;
import com.skplanet.syruppay.token.claims.PayConfigurer;
import com.skplanet.syruppay.token.claims.SubscriptionConfigurer;
import com.skplanet.syruppay.token.claims.*;
import com.skplanet.syruppay.token.claims.MerchantUserClaim;
import com.skplanet.syruppay.token.jwt.SyrupPayToken;
import com.skplanet.syruppay.token.jwt.Token;
import org.slf4j.Logger;
Expand Down Expand Up @@ -200,71 +196,71 @@ public TokenBuilder expiredMinutes(int expiredMinutes) {
/**
* 시럽페이 로그인을 위한 설정 객체를 확인하여 반환한다.
*
* @return {@link com.skplanet.syruppay.token.claims.MerchantUserConfigurer}
* @return {@link MerchantUserClaim}
* @throws Exception the exception
*/
public MerchantUserConfigurer<TokenBuilder> login() throws Exception {
return getOrApply(new MerchantUserConfigurer<TokenBuilder>());
public MerchantUserClaim<TokenBuilder> login() throws Exception {
return getOrApply(new MerchantUserClaim<TokenBuilder>());
}

/**
* 시럽페이 회원가입을 위한 설정 객체를 확인하여 반환한다.
*
* @return {@link com.skplanet.syruppay.token.claims.MerchantUserConfigurer}
* @return {@link MerchantUserClaim}
* @throws Exception the exception
*/
public MerchantUserConfigurer<TokenBuilder> signUp() throws Exception {
return getOrApply(new MerchantUserConfigurer<TokenBuilder>());
public MerchantUserClaim<TokenBuilder> signUp() throws Exception {
return getOrApply(new MerchantUserClaim<TokenBuilder>());
}

/**
* 시럽페이 결제를 위한 설정 객체를 확인하여 반환한다.
*
* @return {@link com.skplanet.syruppay.token.claims.PayConfigurer}
* @return {@link PayClaim}
* @throws Exception the exception
*/
public PayConfigurer<TokenBuilder> pay() throws Exception {
return getOrApply(new PayConfigurer<TokenBuilder>());
public PayClaim<TokenBuilder> pay() throws Exception {
return getOrApply(new PayClaim<TokenBuilder>());
}

/**
* 시럽페이 체크아웃 기느을 위한 설정 객체를 확인하여 반환한다.
*
* @return {@link com.skplanet.syruppay.token.claims.OrderConfigurer}
* @return {@link OrderClaim}
* @throws Exception the exception
*/
public OrderConfigurer<TokenBuilder> checkout() throws Exception {
return getOrApply(new OrderConfigurer<TokenBuilder>());
public OrderClaim<TokenBuilder> checkout() throws Exception {
return getOrApply(new OrderClaim<TokenBuilder>());
}

/**
* 시럽페이 사용자 맵핑을 위한 설정 객체를 확인하여 반환한다.
*
* @return {@link com.skplanet.syruppay.token.claims.MapToSyrupPayUserConfigurer}
* @return {@link MapToUserClaim}
* @throws Exception the exception
*/
public MapToSyrupPayUserConfigurer<TokenBuilder> mapToUser() throws Exception {
return getOrApply(new MapToSyrupPayUserConfigurer<TokenBuilder>());
public MapToUserClaim<TokenBuilder> mapToUser() throws Exception {
return getOrApply(new MapToUserClaim<TokenBuilder>());
}

/**
* SKT 사용자인 시럽페이 사용자 맵핑을 위한 설정 객체를 확인하여 반환한다.
*
* @return {@link com.skplanet.syruppay.token.claims.MapToSktUserConfigurer}
* @return {@link MapToSktUserClaim}
* @throws Exception the exception
*/
public MapToSktUserConfigurer<TokenBuilder> mapToSktUser() throws Exception {
return getOrApply(new MapToSktUserConfigurer<TokenBuilder>());
public MapToSktUserClaim<TokenBuilder> mapToSktUser() throws Exception {
return getOrApply(new MapToSktUserClaim<TokenBuilder>());
}

/**
* SKT 사용자인 시럽페이 사용자 맵핑을 위한 설정 객체를 확인하여 반환한다.
*
* @return {@link com.skplanet.syruppay.token.claims.MapToSktUserConfigurer}
* @return {@link MapToSktUserClaim}
* @throws Exception the exception
*/
public SubscriptionConfigurer<TokenBuilder> subscription() throws Exception {
return getOrApply(new SubscriptionConfigurer<TokenBuilder>());
public SubscriptionClaim<TokenBuilder> subscription() throws Exception {
return getOrApply(new SubscriptionClaim<TokenBuilder>());
}

@SuppressWarnings("unchecked")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
* @author 임형태
* @since 1.0
*/
abstract class AbstractTokenConfigurer<T extends AbstractTokenConfigurer<T, B>, B extends Builder<B>> extends ClaimConfigurerAdapter<Jwt, B> {
abstract class AbstractTokenClaim<T extends AbstractTokenClaim<T, B>, B extends Builder<B>> extends ClaimConfigurerAdapter<Jwt, B> {

/**
* {@link com.skplanet.syruppay.token.claims.AbstractTokenConfigurer} 을 토큰 Claim 빌드 목록에서 제거한다.
* {@link AbstractTokenClaim} 을 토큰 Claim 빌드 목록에서 제거한다.
*
* @return 수정된 {@link com.skplanet.syruppay.token.ClaimBuilder}를 반환한다.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* @since 1.0
*/
@Deprecated
public class MapToSktUserConfigurer<H extends Builder<H>> extends AbstractTokenConfigurer<MapToSktUserConfigurer<H>, H> {
public class MapToSktUserClaim<H extends Builder<H>> extends AbstractTokenClaim<MapToSktUserClaim<H>, H> {
private String lineNumber;
private String svcMgmtNumber;

Expand All @@ -52,12 +52,12 @@ public String getSvcMgmtNumber() {
return svcMgmtNumber;
}

public MapToSktUserConfigurer<H> withLineNumber(String lineNumber) {
public MapToSktUserClaim<H> withLineNumber(String lineNumber) {
this.lineNumber = lineNumber;
return this;
}

public MapToSktUserConfigurer<H> withServiceManagementNumber(String serviceManagementNumber) {
public MapToSktUserClaim<H> withServiceManagementNumber(String serviceManagementNumber) {
this.svcMgmtNumber = serviceManagementNumber;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
*
* @param <H> {@link Builder}
* @author 임형태
* @see com.skplanet.syruppay.token.claims.MapToSyrupPayUserConfigurer.MappingType
* @see MapToUserClaim.MappingType
* @since 1.0
*/
public class MapToSyrupPayUserConfigurer<H extends Builder<H>> extends AbstractTokenConfigurer<MapToSyrupPayUserConfigurer<H>, H> {
public class MapToUserClaim<H extends Builder<H>> extends AbstractTokenClaim<MapToUserClaim<H>, H> {
private static final ObjectMapper MAPPER = new ObjectMapper();

private MappingType mappingType;
Expand All @@ -54,16 +54,16 @@ public String getIdentityAuthenticationId() {
return identityAuthenticationId;
}

public MapToSyrupPayUserConfigurer<H> withIdentityAuthenticationId(String identityAuthenticationId) {
public MapToUserClaim<H> withIdentityAuthenticationId(String identityAuthenticationId) {
this.identityAuthenticationId = identityAuthenticationId;
return this;
}

/**
* 시럽페이 사용자 정보를 맵핑하는 방식을 반환한다.
*
* @return {@link com.skplanet.syruppay.token.claims.MapToSyrupPayUserConfigurer.MappingType}
* @see com.skplanet.syruppay.token.claims.MapToSyrupPayUserConfigurer.MappingType
* @return {@link MapToUserClaim.MappingType}
* @see MapToUserClaim.MappingType
*/
public MappingType getMappingType() {
return mappingType;
Expand All @@ -89,21 +89,21 @@ public Personal getPersonalIfNotExistThenNullWith(final String key) throws IOExc
/**
* 시럽페이 사용자 정보를 맵핑하기 위한 방식을 지정한다.
*
* @param type {@link com.skplanet.syruppay.token.claims.MapToSyrupPayUserConfigurer.MappingType}
* @param type {@link MapToUserClaim.MappingType}
* @return <code>this</code>
*/
public MapToSyrupPayUserConfigurer<H> withType(final MappingType type) {
public MapToUserClaim<H> withType(final MappingType type) {
this.mappingType = type;
return this;
}

/**
* 시럽페이 사용자 정보를 매핑하기 위한 값을 지정한다.
*
* @param value {@link com.skplanet.syruppay.token.claims.MapToSyrupPayUserConfigurer.MappingType}의 값
* @param value {@link MapToUserClaim.MappingType}의 값
* @return <code>this</code>
*/
public MapToSyrupPayUserConfigurer<H> withValue(final String value) {
public MapToUserClaim<H> withValue(final String value) {
this.mappingValue = value;
return this;
}
Expand All @@ -118,7 +118,7 @@ public MapToSyrupPayUserConfigurer<H> withValue(final String value) {
* @throws IOException
* @since 1.3.8
*/
public MapToSyrupPayUserConfigurer<H> withValue(final Personal p, final String kid, final String key) throws IOException {
public MapToUserClaim<H> withValue(final Personal p, final String kid, final String key) throws IOException {
this.mappingValue = new Jose().configuration(
JoseBuilders.JsonEncryptionCompactSerializationBuilder()
.header(new JoseHeader(Jwa.A128KW, Jwa.A128CBC_HS256, kid))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* @author 임형태
* @since 1.0
*/
public final class MerchantUserConfigurer<H extends Builder<H>> extends AbstractTokenConfigurer<MerchantUserConfigurer<H>, H> {
public final class MerchantUserClaim<H extends Builder<H>> extends AbstractTokenClaim<MerchantUserClaim<H>, H> {
private String mctUserId;
private String extraUserId;
@Deprecated
Expand All @@ -42,7 +42,7 @@ public final class MerchantUserConfigurer<H extends Builder<H>> extends Abstract
@JsonProperty("SSOPolicy")
private SsoPolicy ssoPolicy;

public MerchantUserConfigurer() {
public MerchantUserClaim() {
}

/**
Expand Down Expand Up @@ -97,7 +97,7 @@ public SsoPolicy getSsoPolicy() {
* @param ssoCredential sso credential
* @return <code>this</code>
*/
public MerchantUserConfigurer<H> withSsoCredential(String ssoCredential) {
public MerchantUserClaim<H> withSsoCredential(String ssoCredential) {
this.ssoCredential = ssoCredential;
return this;
}
Expand All @@ -109,7 +109,7 @@ public MerchantUserConfigurer<H> withSsoCredential(String ssoCredential) {
* @param merchantUserId 회원 ID
* @return <code>this</code>
*/
public MerchantUserConfigurer<H> withMerchantUserId(String merchantUserId) {
public MerchantUserClaim<H> withMerchantUserId(String merchantUserId) {
this.mctUserId = merchantUserId;
return this;
}
Expand All @@ -120,7 +120,7 @@ public MerchantUserConfigurer<H> withMerchantUserId(String merchantUserId) {
* @param extraMerchantUserId 추가 가맹점 회원 ID
* @return <code>this</code>
*/
public MerchantUserConfigurer<H> withExtraMerchantUserId(String extraMerchantUserId) {
public MerchantUserClaim<H> withExtraMerchantUserId(String extraMerchantUserId) {
this.extraUserId = extraMerchantUserId;
return this;
}
Expand All @@ -131,7 +131,7 @@ public MerchantUserConfigurer<H> withExtraMerchantUserId(String extraMerchantUse
* @param implicitSSOSeed Seed 값
* @return <code>this</code>
*/
public MerchantUserConfigurer<H> withImplicitSSOSeed(String implicitSSOSeed) {
public MerchantUserClaim<H> withImplicitSSOSeed(String implicitSSOSeed) {
this.implicitSSOSeed = implicitSSOSeed;
return this;
}
Expand All @@ -141,12 +141,12 @@ public MerchantUserConfigurer<H> withImplicitSSOSeed(String implicitSSOSeed) {
*
* @param deviceIdentifier device 를 식별할 수 있는 ID 값
*/
public MerchantUserConfigurer<H> withDeviceIdentifier(String deviceIdentifier) {
public MerchantUserClaim<H> withDeviceIdentifier(String deviceIdentifier) {
this.deviceIdentifier = deviceIdentifier;
return this;
}

public MerchantUserConfigurer<H> isNotApplicableSso() {
public MerchantUserClaim<H> isNotApplicableSso() {
this.ssoPolicy = SsoPolicy.NOT_APPLICABLE;
return this;
}
Expand Down
Loading

0 comments on commit 79ff414

Please sign in to comment.