createAccessToken

@POST(value = "api/auth/token")
abstract suspend fun createAccessToken(@Query(value = "projectIds") projectIds: @JvmSuppressWildcards Set<String>? = null, @Query(value = "permissions") permissions: @JvmSuppressWildcards Set<String>? = null, @Query(value = "expiresInHours") expiresInHours: Float? = 2.0f): String

Create a new access token Create a new short-lived access token, optionally limited to the provided permissions and projects. Users do not need any specific Develocity permission to do this. If an access key is used to authenticate this request, the created token will be limited to the user's permissions and projects. If an access token is used to authenticate this request, the created token will be limited to the authenticating token's permissions and projects and not live longer than the authenticating token's remaining lifetime. Query parameters can be used to further restrict the permissions of the access token. A 403 response will be sent if one of the projects or permissions present in the query parameters is not assigned to this user. A 403 will also be sent if an access token is used to authenticate the request and the requested expiration date is after the authenticating access token's expiration. Responses:

  • 200: An access token

  • 400: The request cannot be fulfilled due to a problem.

  • 403: The current user or authenticating access token does not have sufficient access or lifetime to create the requested access token.

  • 404: The referenced resource either does not exist or the permissions to know about it are missing.

  • 500: The server encountered an unexpected error.

Return

kotlin.String

Parameters

projectIds

Limit the created token to one or more projects. Values should be project ids. Comma seperated values and repeated parameters are supported. (optional)

permissions

Limit the created token to one or more permissions. Values should be permission config values. Comma seperated values and repeated parameters are supported. (optional)

expiresInHours

The lifetime of the created token, in hours. (optional, default to 2f)