Skip to content

Commit 7a471c4

Browse files
fix : remove unnecessary lombok settings for the two entities
1 parent 85c15f2 commit 7a471c4

File tree

3 files changed

+71
-8
lines changed

3 files changed

+71
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ For v2, using the database tables from Spring Security 5 (only the database tabl
7171

7272
* Separated UserDetails implementation for Admin and Customer roles as an example. (This can be extended as desired by implementing ``UserDetailsServiceFactory``)
7373
* For versions greater than or equal to v3, including the latest version (Spring Security 6), provide MySQL DDL, which consists of ``oauth2_authorization`` and ``oauth2_registered_client``.
74-
* For v2 (Spring Security 5), provide MySQL DDL, which consists of ``oauth_access_token, oauth_refresh_token and oauth_client_details``, which are tables in Security 5. As I meant to migrate current security system to Security 6 back then, I hadn't changed them to the ``oauth2_authorization`` table indicated in https://github.com/spring-projects/spring-authorization-server.
74+
* For v2, provide MySQL DDL, which consists of ``oauth_access_token, oauth_refresh_token and oauth_client_details``, which are tables in Security 5. As I meant to migrate current security system to Security 6 back then, I hadn't changed them to the ``oauth2_authorization`` table indicated in https://github.com/spring-projects/spring-authorization-server.
7575

7676
* Application of Spring Rest Docs
7777

src/main/java/io/github/patternknife/securityhelper/oauth2/api/config/security/entity/KnifeAuthorization.java

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,18 @@
44
import io.github.patternknife.securityhelper.oauth2.api.config.security.util.SerializableObjectConverter;
55
import jakarta.persistence.*;
66

7-
import lombok.Data;
7+
import lombok.Getter;
8+
import lombok.Setter;
89
import org.hibernate.annotations.DynamicUpdate;
9-
import org.springframework.security.oauth2.core.OAuth2AccessToken;
10-
import org.springframework.security.oauth2.core.OAuth2RefreshToken;
1110
import org.springframework.security.oauth2.server.authorization.OAuth2Authorization;
1211

1312
import java.time.Instant;
1413
import java.time.LocalDateTime;
1514

1615
@Table(name="oauth2_authorization")
1716
@Entity
18-
@Data
19-
@DynamicUpdate
17+
@Getter
18+
@Setter
2019
public class KnifeAuthorization {
2120

2221
// From Oauth2Authorization, oAuth2Authorization.getId() (refer to 'Spring-Authorization-Server')
@@ -158,4 +157,47 @@ public OAuth2Authorization getAttributes() {
158157
public void setAttributes(OAuth2Authorization authorization) {
159158
this.attributes = SerializableObjectConverter.serializeAuthentication(authorization);
160159
}
160+
161+
162+
@Override
163+
public String toString() {
164+
return "KnifeAuthorization{" +
165+
"id='" + id + '\'' +
166+
", registeredClientId='" + registeredClientId + '\'' +
167+
", principalName='" + principalName + '\'' +
168+
", authorizationGrantType='" + authorizationGrantType + '\'' +
169+
", authorizedScopes='" + authorizedScopes + '\'' +
170+
", attributes='" + attributes + '\'' +
171+
", state='" + state + '\'' +
172+
", authorizationCodeValue='" + authorizationCodeValue + '\'' +
173+
", authorizationCodeIssuedAt=" + authorizationCodeIssuedAt +
174+
", authorizationCodeExpiresAt=" + authorizationCodeExpiresAt +
175+
", authorizationCodeMetadata='" + authorizationCodeMetadata + '\'' +
176+
", accessTokenValue='" + accessTokenValue + '\'' +
177+
", accessTokenIssuedAt=" + accessTokenIssuedAt +
178+
", accessTokenExpiresAt=" + accessTokenExpiresAt +
179+
", accessTokenMetadata='" + accessTokenMetadata + '\'' +
180+
", accessTokenType='" + accessTokenType + '\'' +
181+
", accessTokenScopes='" + accessTokenScopes + '\'' +
182+
", accessTokenAppToken='" + accessTokenAppToken + '\'' +
183+
", accessTokenUserAgent='" + accessTokenUserAgent + '\'' +
184+
", accessTokenRemoteIp='" + accessTokenRemoteIp + '\'' +
185+
", refreshTokenValue='" + refreshTokenValue + '\'' +
186+
", refreshTokenIssuedAt=" + refreshTokenIssuedAt +
187+
", refreshTokenExpiresAt=" + refreshTokenExpiresAt +
188+
", refreshTokenMetadata='" + refreshTokenMetadata + '\'' +
189+
", oidcIdTokenValue='" + oidcIdTokenValue + '\'' +
190+
", oidcIdTokenIssuedAt=" + oidcIdTokenIssuedAt +
191+
", oidcIdTokenExpiresAt=" + oidcIdTokenExpiresAt +
192+
", oidcIdTokenMetadata='" + oidcIdTokenMetadata + '\'' +
193+
", userCodeValue='" + userCodeValue + '\'' +
194+
", userCodeIssuedAt=" + userCodeIssuedAt +
195+
", userCodeExpiresAt=" + userCodeExpiresAt +
196+
", userCodeMetadata='" + userCodeMetadata + '\'' +
197+
", deviceCodeValue='" + deviceCodeValue + '\'' +
198+
", deviceCodeIssuedAt=" + deviceCodeIssuedAt +
199+
", deviceCodeExpiresAt=" + deviceCodeExpiresAt +
200+
", deviceCodeMetadata='" + deviceCodeMetadata + '\'' +
201+
'}';
202+
}
161203
}

src/main/java/io/github/patternknife/securityhelper/oauth2/api/config/security/entity/KnifeClient.java

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@
55
import jakarta.persistence.Id;
66
import jakarta.persistence.Table;
77
import lombok.Data;
8+
import lombok.Getter;
9+
import lombok.Setter;
810
import org.hibernate.annotations.DynamicUpdate;
911

1012
import java.time.Instant;
1113

1214
@Entity
1315
@Table(name = "oauth2_registered_client")
14-
@Data
15-
@DynamicUpdate
16+
@Getter
17+
@Setter
1618
public class KnifeClient {
1719

1820
// UUID.randomUUID().toString() (refer to 'Spring-Authorization-Server')
@@ -55,4 +57,23 @@ public class KnifeClient {
5557

5658
@Column(name = "token_settings", length = 2000, nullable = false)
5759
private String tokenSettings;
60+
61+
@Override
62+
public String toString() {
63+
return "KnifeClient{" +
64+
"id='" + id + '\'' +
65+
", clientId='" + clientId + '\'' +
66+
", clientIdIssuedAt=" + clientIdIssuedAt +
67+
", clientSecret='" + clientSecret + '\'' +
68+
", clientSecretExpiresAt=" + clientSecretExpiresAt +
69+
", clientName='" + clientName + '\'' +
70+
", clientAuthenticationMethods='" + clientAuthenticationMethods + '\'' +
71+
", authorizationGrantTypes='" + authorizationGrantTypes + '\'' +
72+
", redirectUris='" + redirectUris + '\'' +
73+
", postLogoutRedirectUris='" + postLogoutRedirectUris + '\'' +
74+
", scopes='" + scopes + '\'' +
75+
", clientSettings='" + clientSettings + '\'' +
76+
", tokenSettings='" + tokenSettings + '\'' +
77+
'}';
78+
}
5879
}

0 commit comments

Comments
 (0)