Package-level declarations

Types

Link copied to clipboard
data class AuthorizationData(val scopeAndId: String, val codeChallenge: ByteString, val expiration: Instant)
Link copied to clipboard
class Identity

Class that holds id and data for a given person.

Link copied to clipboard
class IdentityData(val core: Map<String, DataItem>, val records: Map<String, Map<String, DataItem>>)

Class that holds data for a person.

Link copied to clipboard

Thrown when the requested Identity cannot be found in the storage.

Link copied to clipboard
Link copied to clipboard
data class OauthParams(val scope: String, val codeChallenge: ByteString, val clientState: String?, val redirectUri: String, val expiration: Instant)
Link copied to clipboard
class RecordType(val attribute: DocumentAttribute, val subAttributes: Map<String, RecordType> = mapOf())

A class that describes type of a particular record or field.

Link copied to clipboard

Types of tokens for client-server communication.

Properties

Link copied to clipboard

Describes schema of the data stored in Identity. Record type with the identifier "core" describes core data, other record types describe possible records.

Functions

Link copied to clipboard
suspend fun idToToken(type: TokenType, id: String, expiresIn: Duration): String

Creates an opaque token that can be safely given to the client. On the server the Identity objects are identified by its id, which stays the same. When referencing an identity from the client, we do not want the client to be able to play any games, thus the actual server-side id and a small amount of metadata is encrypted using server secret key.

Link copied to clipboard
fun JsonElement.toDataItem(recordType: RecordType): DataItem

Converts JsonElement to DataItem based on the given record type.

Link copied to clipboard
fun DataItem.toJson(): JsonElement

Converts DataItem to JsonElement.

Link copied to clipboard
suspend fun tokenToId(type: TokenType, code: String): String

Decodes a token into server-side id, its type and expiration time.

Link copied to clipboard
suspend fun validateJwt(jwt: String, jwtName: String, publicKey: EcPublicKey?, algorithm: Algorithm? = publicKey?.curve?.defaultSigningAlgorithmFullySpecified, checks: Map<JwtCheck, String> = mapOf(), maxValidity: Duration = 10.hours, clock: Clock = Clock.System): JsonObject

General-purpose JWT jwt validation using a set of built-in required checks (expiration and signature validity) and a set of optional checks specified in checks parameter.