Ir para o conteúdo
NimbusNexus

Usuários

Um usuário é uma identidade dentro de um workspace. Os usuários têm funções nos projetos do workspace (que concedem permissões) e podem gerar chaves de API (cada uma pertence ao usuário e tem escopo de um único projeto).

Usuário ≠ login

Um "usuário" nesta API é o registro de identidade, não o ser humano. Cada usuário pertence a exatamente um workspace, e o nome dele é único ali. Dentro do workspace, o mesmo usuário pode ter funções diferentes em projetos diferentes:

  • Uma função em prod (o projeto de produção)
  • Outra função em staging
  • Nenhuma função em dev

O que um usuário pode fazer em um projeto vem das funções que ele tem ali, concedidas diretamente ou por meio de um grupo. Essa é a fronteira em que se apoiar para conter o raio de impacto: conceda funções em prod só aos usuários que precisam delas.

O que você pode fazer com um usuário

  • Criar — adiciona um usuário ao workspace de quem chama, com um name e, opcionalmente, um password, uma description e a flag enabled.
  • Obter — lê o registro de um usuário pelo ID.
  • Atualizar — altera o nome, a descrição, a flag enabled ou a senha.
  • Excluir — remove permanentemente. Todas as atribuições de função e chaves de API do usuário são revogadas de forma atômica.

As quatro exigem a função admin e uma sessão com escopo do próprio workspace, não de um dos projetos dele. Uma chave de API sempre tem escopo de um único projeto, então uma chamada com uma chave a qualquer uma delas recebe 400.

Uma senha entra e nunca sai: o registro de um usuário só tem id, name, description e enabled.

Não existe "desativar" separado de "excluir". Se você quer uma desativação lógica (manter o histórico de auditoria, impedir o login), defina enabled: false com uma atualização — esse é o caminho da desativação lógica. Excluir é exclusão física + revogar tudo.

O que você não pode fazer

  • Mover um usuário para outro workspace. Crie um novo usuário no workspace de destino, conceda ali as funções que quiser e exclua o antigo. Dentro de um workspace não há nada para mover: conceda ao usuário uma função no outro projeto.
  • Alcançar um usuário de outro workspace. Obter, atualizar e excluir só encontram usuários do workspace de quem chama. Para qualquer outro, a API retorna 404.

Próximos passos

  • Workspaces — o contêiner em que os usuários ficam.
  • Funções — o que conceder a um usuário depois que ele existe.
  • Autenticação — como funcionam as chaves de API (emitidas por usuário).

Reference

POST/api/v1/api_keys/

Create Api Key

Create an application credential (API key) in project_id, or in the session's project when that is left out. The secret is returned only once.

Request body

FieldTypeDescription
name*string—
project_idstring | nullThe project the key works in. Required unless the session is scoped to a project, which is then the default.
secretstring | nullIf omitted, Keystone generates it
descriptionstring | null—
expires_atstring | nullISO8601 datetime
rolesarray of string | nullRole names or IDs. If omitted, Keystone uses defaults (usually user's roles in the project).
unrestrictedbooleanPotentially dangerous. Default is restricted behavior.
access_rulesarray of ApiKeyAccessRuleIn | null—

Responses

  • 201Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 409Conflict
  • 422Validation error
  • 500Internal Server Error
  • 503Service Unavailable

Example

curl -X POST "https://api.nimbusnexus.net/api/v1/api_keys/" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Example"
  }'
GET/api/v1/api_keys/access_rules/list

List Access Rules

List the access rules associated with a user's application credentials.

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Validation error
  • 500Internal Server Error

Example

curl -X GET "https://api.nimbusnexus.net/api/v1/api_keys/access_rules/list" \
  -H "Authorization: Bearer $NIMBUS_KEY"
GET/api/v1/api_keys/access_rules/{access_rule_id}

Get Access Rule

Show the details of a single access rule by id.

Parameters

NameInTypeDescription
access_rule_id*pathstring—

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Validation Error
  • 500Internal Server Error

Example

curl -X GET "https://api.nimbusnexus.net/api/v1/api_keys/access_rules/<access_rule_id>" \
  -H "Authorization: Bearer $NIMBUS_KEY"
DELETE/api/v1/api_keys/access_rules/{access_rule_id}

Delete Access Rule

Delete an access rule by id.

Parameters

NameInTypeDescription
access_rule_id*pathstring—

Responses

  • 204Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Validation error
  • 500Internal Server Error

Example

curl -X DELETE "https://api.nimbusnexus.net/api/v1/api_keys/access_rules/<access_rule_id>" \
  -H "Authorization: Bearer $NIMBUS_KEY"
GET/api/v1/api_keys/access_rules_artifacts

Access Rules Artifacts

Returns a complete list of methods and paths registered in FastAPI.

Parameters

NameInTypeDescription
paramsquerystring | null—

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 422Validation error
  • 500Internal Server Error

Example

curl -X GET "https://api.nimbusnexus.net/api/v1/api_keys/access_rules_artifacts" \
  -H "Authorization: Bearer $NIMBUS_KEY"
GET/api/v1/api_keys/list

List Api Keys

List the current user's application credentials (API keys) in the session's workspace, each with its project_id. Secrets are never returned.

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 500Internal Server Error

Example

curl -X GET "https://api.nimbusnexus.net/api/v1/api_keys/list" \
  -H "Authorization: Bearer $NIMBUS_KEY"
GET/api/v1/api_keys/{api_key_id}

Get Api Key

Get a single application credential (API key) in the session's workspace by id.

Parameters

NameInTypeDescription
api_key_id*pathstring—

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Validation Error
  • 500Internal Server Error

Example

curl -X GET "https://api.nimbusnexus.net/api/v1/api_keys/<api_key_id>" \
  -H "Authorization: Bearer $NIMBUS_KEY"
DELETE/api/v1/api_keys/{api_key_id}

Delete Api Key

Delete (revoke) an application credential (API key) in the session's workspace.

Parameters

NameInTypeDescription
api_key_id*pathstring—

Responses

  • 204Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Validation error
  • 500Internal Server Error

Example

curl -X DELETE "https://api.nimbusnexus.net/api/v1/api_keys/<api_key_id>" \
  -H "Authorization: Bearer $NIMBUS_KEY"
GET/api/v1/users/

List Users

List the users of the caller's workspace/project, derived from their role assignments in the scope. Each user is flagged as a full member, an invited (not-yet-accepted) account, or unassigned (no role). Filter with type (all/invited/members/unassigned) and narrow by group membership or a name search. In a workspace scope all covers everyone: members, invitees and the workspace's role-less accounts. In a project scope it covers members and invitees; role-less accounts need type=unassigned there.

Parameters

NameInTypeDescription
groupquerystring | null—
searchquerystring | null—
typequery"all" | "invited" | "members" | "unassigned"—

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X GET "https://api.nimbusnexus.net/api/v1/users/" \
  -H "Authorization: Bearer $NIMBUS_KEY"
POST/api/v1/users/

Create User

Create a new user in the caller's workspace with the given name, password and enabled flag. Refused with 403 where the deployment signs in through Keycloak: invite people in the account console there.

Request body

FieldTypeDescription
name*string—
passwordstring | null—
descriptionstring | null—
enabledboolean | null—

Responses

  • 201Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X POST "https://api.nimbusnexus.net/api/v1/users/" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Example"
  }'
GET/api/v1/users/{user_id}

Get User

Retrieve a single user by ID, scoped to the caller's workspace.

Parameters

NameInTypeDescription
user_id*pathstring—

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X GET "https://api.nimbusnexus.net/api/v1/users/<user_id>" \
  -H "Authorization: Bearer $NIMBUS_KEY"
PATCH/api/v1/users/{user_id}

Update User

Update mutable attributes (name, description, enabled, password) of a user in the caller's workspace and return the updated record.

Parameters

NameInTypeDescription
user_id*pathstring—

Request body

FieldTypeDescription
namestring | null—
passwordstring | null—
descriptionstring | null—
enabledboolean | null—

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X PATCH "https://api.nimbusnexus.net/api/v1/users/<user_id>" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
DELETE/api/v1/users/{user_id}

Delete User

Permanently delete a user in the caller's workspace by ID.

Parameters

NameInTypeDescription
user_id*pathstring—

Responses

  • 204Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X DELETE "https://api.nimbusnexus.net/api/v1/users/<user_id>" \
  -H "Authorization: Bearer $NIMBUS_KEY"

Need to make a real call? Try these endpoints in the live Swagger UI →