Create API Key
Creates a key on the calling service account's application and returns its secret exactly once. The owner is a user, a service account, a team or one of the application's resources; scopes are checked against the application's scope set and the owner's current cap. Auth cannot know who owns a product resource, so the calling service account vouches that the acting user may bind the resources named — it is recorded as the key's asserted_by.
Service accounts only.
Required scopes: auth:api-keys:manage
JWT access token obtained via OAuth2 flow or service account
In: header
Header Parameters
Define the version of the Connect protocol
Define the timeout, in ms
Request Body
application/json
URN of the user acting through the product. Required for a USER-owned key (it must be the owner); for a TEAM-owned key it must be a member of the team; otherwise recorded as created_by.
length <= 1281 <= length <= 64length <= 512items <= 64Whether a key reaches everything its owner can, or only the resources it is bound to. Set explicitly; never inferred from how many bindings there are.
"API_KEY_RESOURCE_MODE_UNSPECIFIED" | "API_KEY_RESOURCE_MODE_APP_WIDE" | "API_KEY_RESOURCE_MODE_BOUND"items <= 50validate:skip opaque; size-checked in the handler
validate:skip bounded by the application's policy in the handler
date-timeResponse Body
application/json
application/json
curl -X POST "https://auth.xeonr.io/xeonr.auth.api.v1.ApiKeysService/CreateApiKey" \ -H "Connect-Protocol-Version: 1" \ -H "Connect-Timeout-Ms: 1000" \ -H "Content-Type: application/json" \ -d '{ "owner": {} }'{
"key": {
"keyId": "urn:xeonr:auth:api-key:7e0c1e52-3a0d-4a0a-9b2e-2f0f7a1b9c3d",
"name": "string",
"description": "string",
"keyPrefix": "string",
"applicationId": "string",
"applicationSlug": "string",
"applicationName": "string",
"owner": {
"kind": "API_KEY_OWNER_KIND_UNSPECIFIED",
"urn": "urn:xeonr:auth:team:0f3c9a2e-8f1b-4c2d-9e6a-1b2c3d4e5f60",
"resourceType": "bucket",
"resourceId": "bkt_01J9W3E8Q9"
},
"subject": "string",
"identityless": true,
"scopes": [
"string"
],
"effectiveScopes": [
"string"
],
"resourceMode": "API_KEY_RESOURCE_MODE_UNSPECIFIED",
"bindings": [
{
"resourceType": "string",
"resourceId": "string",
"scopes": [
"string"
],
"effectiveScopes": [
"string"
],
"label": "string"
}
],
"attributes": {
"property1": {},
"property2": {}
},
"expiresAt": "2023-01-15T01:30:15.01Z",
"lastUsedAt": "2023-01-15T01:30:15.01Z",
"revokedAt": "2023-01-15T01:30:15.01Z",
"createdAt": "2023-01-15T01:30:15.01Z",
"updatedAt": "2023-01-15T01:30:15.01Z",
"createdBy": "string",
"assertedBy": "string",
"version": "string",
"legacyPrefix": "string"
},
"secret": "string"
}xeonr.auth.api.v1.ApiKeysService
ApiKeysService is how a product issues and verifies API keys without implementing them. Every method is for the product's own service account, about the product's own application: a key is created, listed, updated, revoked and verified only by the application it belongs to. Keys are long-lived bearer secrets of the form `xk_<40 chars><6-char checksum>`, stored hashed and returned exactly once. A product presents a key it receives to VerifyApiKey (go-platform's authn does this, with a short cache) and acts on the answer. Auth itself never accepts an API key as a caller credential; a key is only ever a token in VerifyApiKey's request body.
Get API Key POST
Returns one of the application's keys, with effective scopes. Service accounts only. **Required scopes:** `auth:api-keys:manage`