Get started with Platform
See the keys your realm signs and seals with, then give the engineering team a realm of its own beneath yours, with every call.
AvailableAPI
In this walkthrough you look at what your realm foobar stands on, then hand a team a realm of its own. First you list
the keys foobar signs its tokens and seals its data with, and see the public half apps verify against. Then you
create the sub-realm engineering beneath foobar, with a host name and a first administrator of its own. At the
end, the engineering team runs its realm, and you still reach into it from yours.
Before you begin
Section titled “Before you begin”- You are a realm administrator of
foobar, in a group that holdsRealmOwner, with your session in$CVYUH_SESSION: Call the API shows how to get it. - Sub-realms are turned on for
foobar. If creating one answers403, “sub-realms are not turned on”, ask Cvyūh. - Admin calls go to
https://foobar.cvyuh.com/api/v0/am, and calls about realms tohttps://foobar.cvyuh.com/api/v0/am/global/realms/v1.
See your realm’s keys
Section titled “See your realm’s keys”-
List the keys. Every version of every key the realm holds, and never what’s in them:
Terminal window curl https://foobar.cvyuh.com/api/v0/am/keys/v1 \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION"{"data": [{ "key": "oauth2/signing", "version": 1, "alg": "ES256", "state": "valid", "validFrom": "<RFC 3339 time>" },{ "key": "oauth2/signing", "version": 2, "alg": "RS256", "state": "valid", "validFrom": "<RFC 3339 time>" },{ "key": "oauth2/signing", "version": 3, "alg": "PS256", "state": "valid", "validFrom": "<RFC 3339 time>" },{ "key": "oauth2/signing/cluster-local", "version": 1, "alg": "ES256", "state": "valid", "validFrom": "<RFC 3339 time>" },{ "key": "store/encryption", "version": 1, "alg": "chacha20poly1305", "state": "valid", "validFrom": "<RFC 3339 time>" }]}oauth2/signingholds one signing key for each algorithm,store/encryptionis the key the realm seals its stored data with, andoauth2/signing/cluster-localis the internal signing key, for tokens that never leave Cvyūh, which you never need to touch. Avalidversion is in use; aretainedone is kept only to verify, or open, what it signed or sealed. -
See what apps verify against. The public halves of the signing keys are published, for anyone:
Terminal window curl -i https://foobar.cvyuh.com/oauth2/jwksEach key’s
kidis its thumbprint. The answer’sCache-Control: public, max-age=300is how long apps may keep it, and why a new key is published an hour before it signs anything: see Signing keys.
Hand a team its own realm
Section titled “Hand a team its own realm”-
Find your realm. The realms list shows your realm and every realm beneath it. The answer, in part:
Terminal window curl https://foobar.cvyuh.com/api/v0/am/global/realms/v1 \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION"{"data": [{ "id": "<realm id>", "name": "foobar", "path": "/foobar", "parentPath": "/", "status": "active","hostnames": ["foobar.cvyuh.com"], "rev": 3, "createTime": "<RFC 3339 time>", "products": ["…"] }]}A new realm names its parent by the parent’s
path: here/foobar. -
Create the sub-realm. Name it, place it beneath
foobar, give it a host name of its own, and set the password of its first administrator:Terminal window curl -i https://foobar.cvyuh.com/api/v0/am/global/realms/v1 \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \-H "Content-Type: application/json" \-d '{ "name": "engineering","parentPath": "/foobar","hostnames": ["foobar-engineering.cvyuh.com"],"password": "<a strong first password>","mailId": "maya@example.com" }'The realm answers
202 Acceptedwith the new realm’sid, itsstatuscreating, and aLocationto poll. Its keys, settings, first administrator and host name are being made, usually within seconds. -
Wait until it’s active.
Terminal window curl https://foobar.cvyuh.com/api/v0/am/global/realms/v1/<realm id> \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION"Poll until
statusisactive. If it showsfailed, with acodeandreason, resume it withcurl -X POST https://foobar.cvyuh.com/api/v0/am/global/realms/v1/<realm id>/resumeand the same headers, and-d '{}'. -
Hand it over. Give the engineering team its address and its first administrator: they sign in at
https://foobar-engineering.cvyuh.comasadmin@engineering, with the password you set, and should change it at once. That user is in the groupengineering_admins, which holds the realm’sRealmOwner: from there, the team adds its own users and administrators, and creates realms of its own beneath.
Check it worked
Section titled “Check it worked”Your reach runs down into the new realm. With your own session, list who administers it, on its host:
curl https://foobar-engineering.cvyuh.com/api/v0/am/privilege/v1 \ -H "Cookie: x-cvyuh-token=$CVYUH_SESSION"{ "privileges": [ { "name": "RealmOwner", "groups": ["engineering_admins"], "allAuthenticated": false }, { "name": "RealmViewer", "groups": [], "allAuthenticated": false } ]}The team’s reach never climbs: signed in to engineering, admin@engineering is refused every change to foobar.