@Component
class GropiusGraphQLContextFactory(val gropiusUserRepository: GropiusUserRepository, val gropiusPublicApiConfigurationProperties: GropiusPublicApiConfigurationProperties) : DefaultSpringGraphQLContextFactory

Generates the GraphQL context map

Parameters

gropiusUserRepository

used to get the user

gropiusPublicApiConfigurationProperties

used to determine if authentication is optional

Constructors

Link copied to clipboard
constructor(gropiusUserRepository: GropiusUserRepository, gropiusPublicApiConfigurationProperties: GropiusPublicApiConfigurationProperties)

Properties

Link copied to clipboard
Link copied to clipboard
private val jwtParser: JwtParser?

Jwt parser based on the secret defined by gropiusPublicApiConfigurationProperties

Link copied to clipboard
private val publicKey: PublicKey

Public key used to verify JWTs

Functions

Link copied to clipboard
open suspend override fun generateContext(request: ServerRequest): GraphQLContext
Link copied to clipboard
private suspend fun verifyToken(token: String): GropiusUser

Verifies a jwt and returns the GropiusUser defined by the id in subject