Record Class NewApiKey
java.lang.Object
java.lang.Record
org.jwcarman.who.apikey.NewApiKey
- Record Components:
id- the key's credential id, to list, rotate or revoke it byname- the key's namekey- the raw key, sent in the API-key header; never intoString()scopes- the permissions the key may use, at mostexpiresAt- when the key stops signing in
public record NewApiKey(UUID id, String name, String key, Set<String> scopes, Instant expiresAt)
extends Record
A key just made, by
ApiKeyService.create(Identity, String, Duration, Set) or ApiKeyService.rotate(UUID, Duration): the only time
the raw key exists outside the caller. Show it once; who keeps only its hash.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of theexpiresAtrecord component.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.key()Returns the value of thekeyrecord component.name()Returns the value of thenamerecord component.scopes()Returns the value of thescopesrecord component.toString()Describes the key without the raw key, so it is safe to log.
-
Constructor Details
-
NewApiKey
-
-
Method Details
-
toString
-
hashCode
-
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). -
id
-
name
-
key
-
scopes
-
expiresAt
-