The authentication reef

Who the person is, and who the platform is towards the systems it acts on

O reef authentication

Quem a pessoa é, e quem a plataforma é perante os sistemas em que age

Session

How does a person log in from the terminal, and log out?

Sessão

Como uma pessoa entra pelo terminal, e sai?

Session · loginbuilt

The browser opens, and the login comes back to the terminal

Sessão · loginpronto

O navegador abre, e o login volta para o terminal

~/example
# Authorization code with PKCE, on a listener of 127.0.0.1$ nereus loginOpening https://auth.example.com/realms/nereus/protocol/openid-connect/auth?... in the browser.logged in as ana-silva (nereus-users), issuer https://auth.example.com/realms/nereus Next steps:   nereus whoami  https://auth.example.com/realms/nereus/account/account-security/signing-in   (set a password, optional)
Session · --use-device-codebuilt

A machine with no browser logs in from another device

Sessão · --use-device-codepronto

Uma máquina sem navegador entra por outro dispositivo

~/example
# The device grant: open the page elsewhere and type the code$ nereus login \    --use-device-codeOpen https://auth.example.com/realms/nereus/device and enter ABCD-EFGH (expires in 10 minutes).logged in as ana-silva (nereus-users), issuer https://auth.example.com/realms/nereus Next steps:   nereus whoami  https://auth.example.com/realms/nereus/account/account-security/signing-in   (set a password, optional)
Session · --initial-adminbuilt

A new instance has one obvious way in: its initial admin

Sessão · --initial-adminpronto

Uma instância nova tem uma entrada óbvia: o seu admin inicial

~/example
# The password goes to the clipboard, never to the terminal$ nereus login \    --initial-adminThe initial admin's password is in your clipboard (user nereus). Paste it on the login page.Opening https://auth.example.com/realms/nereus/protocol/openid-connect/auth?... in the browser.logged in as nereus (nereus-admins), issuer https://auth.example.com/realms/nereus Next steps:   nereus whoami  https://auth.example.com/realms/nereus/account/account-security/signing-in   (set a password, optional)
Session · --refreshbuilt

A new token without the browser, with the groups read again

Sessão · --refreshpronto

Um token novo sem o navegador, com os grupos lidos de novo

~/example
# Renew the session, so a group joined since the last login shows$ nereus login \    --refreshtoken refreshed for ana-silva, valid until 14:05
Session · logoutbuilt

Logging out ends the session at the identity provider too

Sessão · logoutpronto

Sair encerra a sessão no provedor de identidade também

~/example
# Revoke the session, then delete the credentials$ nereus logoutlogged out nereus@example.com: session revoked, ~/.config/nereus/credentials deleted
Session · whoamibuilt

The Nereus API says who you are

Sessão · whoamipronto

A API do Nereus diz quem você é

~/example
# GET /v1/me with the token of nereus login$ nereus whoamiana-silva (nereus-admins, nereus-users) # The same answer for scripts and agents$ nereus whoami \    --output json{"sub": "<sub8>", "email": "nereus@example.com", "groups": ["nereus-admins", "nereus-users"]}
The platform

How does the platform prove who it is to GitHub?

A plataforma

Como a plataforma prova quem é para o GitHub?

The platform · mandate

A GitHub App is a Mandate of the github Nereid

A plataforma · mandate

Um GitHub App é um Mandate do Nereid github

The platform · app-registerbuilt #1291

With no App yet, the Nereid creates it in the browser

A plataforma · app-registerpronto #1291

Sem App ainda, o Nereid o cria no navegador

~/example
# An action the github Nereid publishes under the reef$ nereus authentication app-register \    --mandate team \    --org example-team→ opening the browser to create the GitHub App "nereus-prod"✓ secrets/team-app-key stored by the Nereid (the key never reaches this machine)✓ secrets/team-webhook-secret and secrets/team-oauth-client stored by the Nereid✓ core/mandates/team configured (appId 900001, privateKey team-app-key, webhookSecret team-webhook-secret) Next steps:   Install it on the org: https://github.com/apps/nereus-prod/installations/new  nereus mandate get team
Token

How does a Nereid read one private repository?

Token

Como um Nereid lê um repositório privado?

Token · token createbuilt #1274

A Token lends one repository for an hour

Token · token createpronto #1274

Um Token empresta um repositório por uma hora

~/example
# A token to read one repository, from the default Mandate$ nereus authentication token create catalog \    --repository example/app \    --permission contents=read✓ authentication/tokens/catalog created (expires in 1h, mandate github) Next steps:   nereus authentication token get catalog # A namespace the Mandate's allow does not name: refused before GitHub is asked, with the line to add$ nereus authentication token create outside \    --namespace team-a \    --repository example/app \    --permission contents=read✗ authentication/tokens/outside created, with no token yet (NotPermitted: mandate github allows no token for namespace team-a on example/app: add --param allow=team-a:example/app:contents=read to it). See 'nereus authentication token get outside'
Token · token listbuilt #1274

list shows each Token, never its value

Token · token listpronto #1274

O list mostra cada Token, nunca o seu valor

~/example
# Every Token$ nereus authentication token listTOKEN    REPOSITORY   PERMISSIONS    MANDATE  EXPIRES  STATUScatalog  example/app  contents=read  github   1h       Ready # Delete one, and its Secret goes with it$ nereus authentication token delete catalog✓ authentication/tokens/catalog deleted Next steps:   nereus authentication token list