Record Class OahJwt
java.lang.Object
java.lang.Record
com.github.catomat0.oauthhelper.jwt.OahJwt
public record OahJwt(OahJwtProvider provider, OahRefreshTokenService refresh, OahRefreshTokenCookieWriter cookie)
extends Record
JWT 관련 서비스를 묶은 파사드.
public AuthController(OahJwt jwt) { this.jwt = jwt; }
String access = jwt.provider().generateAccessToken(userId, role);
String refresh = jwt.provider().generateRefreshToken(userId);
jwt.refresh().save(userId, refresh);
jwt.cookie().write(response, refresh);
Redis / servlet 종속이 없으면 이 파사드는 등록 안 됨 —
그 경우 OahJwtProvider 만 직접 주입.
-
Constructor Summary
ConstructorsConstructorDescriptionOahJwt(OahJwtProvider provider, OahRefreshTokenService refresh, OahRefreshTokenCookieWriter cookie) Creates an instance of aOahJwtrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncookie()Returns the value of thecookierecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.provider()Returns the value of theproviderrecord component.refresh()Returns the value of therefreshrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
OahJwt
public OahJwt(OahJwtProvider provider, OahRefreshTokenService refresh, OahRefreshTokenCookieWriter cookie) Creates an instance of aOahJwtrecord class.- Parameters:
provider- the value for theproviderrecord componentrefresh- the value for therefreshrecord componentcookie- the value for thecookierecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
provider
Returns the value of theproviderrecord component.- Returns:
- the value of the
providerrecord component
-
refresh
Returns the value of therefreshrecord component.- Returns:
- the value of the
refreshrecord component
-
cookie
Returns the value of thecookierecord component.- Returns:
- the value of the
cookierecord component
-