Skip to main content

issuers

Creates, updates, deletes, gets or lists an issuers resource.

Overview

Nameissuers
TypeResource
Idvercel.kms.issuers

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstring
namestring
owner_idstring (wire: ownerId)
algorithmstring (ES256, ES384, ES512, EdDSA, PS256, PS384, PS512, RS256, RS384, RS512)
claims_schemaobject (wire: claimsSchema)
created_atstring (wire: createdAt)
managed_bystring (wire: managedBy)
originstring (external, vercel)
policiesarray
signing_keysarray (wire: signingKeys)
updated_atstring (wire: updatedAt)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectissuer_idteam_id, slugRetrieve a single KMS issuer by its ID. Accepts either a team bearer token (existing path) or an OIDC token authorized by one of the issuer's policies (e.g. a connex-grant token). The OIDC path returns the issuer without policies, since a policy token only proves signing access, not management access.
listselectlimit, next, team_id, slugRetrieve the list of KMS issuers that belong to the authenticated team. The results are paginated.
createinsertnameteam_id, slugCreate a new KMS issuer for the authenticated team. An issuer owns the asymmetric signing keys that are used to sign tokens and messages.
updateupdateissuer_idteam_id, slugUpdate a KMS issuer's name or claims schema.
deletedeleteissuer_idteam_id, slugDelete a KMS issuer and its signing keys.
sign_messageexecissuer_id, messageSign a raw message with a KMS issuer's active signing key. Authenticate the request with a Vercel OIDC token in the Authorization: Bearer header; the issuer's policies decide which workloads are allowed to sign.
sign_tokenexecissuer_idSign a JWT with a KMS issuer's active signing key. Authenticate the request with a Vercel OIDC token in the Authorization: Bearer header; the issuer's policies decide which workloads are allowed to sign.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
issuer_idstringThe ID of the issuer.
limitintegerMaximum number of issuers to return.
nextstringContinuation cursor to retrieve the next page of results.
slugstringThe Team slug to perform the request on behalf of.
team_idstringThe Team identifier to perform the request on behalf of. (wire: teamId)

SELECT examples

Retrieve a single KMS issuer by its ID. Accepts either a team bearer token (existing path) or an OIDC token authorized by one of the issuer's policies (e.g. a connex-grant token). The OIDC path returns the issuer without policies, since a policy token only proves signing access, not management access.

SELECT
id,
name,
owner_id,
algorithm,
claims_schema,
created_at,
managed_by,
origin,
policies,
signing_keys,
updated_at
FROM vercel.kms.issuers
WHERE issuer_id = '{{ issuer_id }}' -- required
AND team_id = '{{ team_id }}'
AND slug = '{{ slug }}'
;

INSERT examples

Create a new KMS issuer for the authenticated team. An issuer owns the asymmetric signing keys that are used to sign tokens and messages.

INSERT INTO vercel.kms.issuers (
name,
algorithm,
claims_schema,
policy,
import_key,
import_key_id,
team_id,
slug
)
SELECT
'{{ name }}' /* required */,
'{{ algorithm }}',
'{{ claims_schema }}',
'{{ policy }}',
'{{ import_key }}',
'{{ import_key_id }}',
'{{ team_id }}',
'{{ slug }}'
RETURNING
id,
name,
owner_id,
algorithm,
claims_schema,
created_at,
managed_by,
origin,
policies,
signing_keys,
updated_at
;

UPDATE examples

Update a KMS issuer's name or claims schema.

UPDATE vercel.kms.issuers
SET
name = '{{ name }}',
claims_schema = '{{ claims_schema }}'
WHERE
issuer_id = '{{ issuer_id }}' --required
AND team_id = '{{ team_id}}'
AND slug = '{{ slug}}'
RETURNING
id,
name,
owner_id,
algorithm,
claims_schema,
created_at,
managed_by,
origin,
policies,
signing_keys,
updated_at;

DELETE examples

Delete a KMS issuer and its signing keys.

DELETE FROM vercel.kms.issuers
WHERE issuer_id = '{{ issuer_id }}' --required
AND team_id = '{{ team_id }}'
AND slug = '{{ slug }}'
;

Lifecycle Methods

EXEC variables use wire (API) names.

Sign a raw message with a KMS issuer's active signing key. Authenticate the request with a Vercel OIDC token in the Authorization: Bearer header; the issuer's policies decide which workloads are allowed to sign.

EXEC vercel.kms.issuers.sign_message
@issuer_id='{{ issuer_id }}' --required
@@json=
'{
"message": "{{ message }}"
}'
;