Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POST /platforms/:platform/auths #38

Open
davidraker opened this issue Mar 7, 2022 · 0 comments
Open

POST /platforms/:platform/auths #38

davidraker opened this issue Mar 7, 2022 · 0 comments

Comments

@davidraker
Copy link
Contributor

davidraker commented Mar 7, 2022

Create authentication/authorization record for an agent running in the VOLTTRON platform.

The <user_id> will become the :auth_user_id in the route returned in the Location header of the response.

Note: A <user_id> can take any value but should be unique on the platform. For local agents, this should be the actual VIP identity. The string, however is arbitrary and may have other values for remote agents to distinguish them from local versions of the same agent. Attempting to create an authorization entry will return 409 Conflict with a Content-Location header pointing to the route of the conflicting record.

Request:

  • Authorization: BEARER <jwt_token>
  • Content Type: application/json
  • Body:
     {
         "domain": "<domain>",
         "address": "<address>",
         "user_id": "<user_id>",
         "capabilities": ["<capability>", ...],
         "roles": ["<role>", ...],
         "groups": ["<group>", ...],
         "mechanism": "<mechanism>",
         "credentials": "<public_key>",
         "comments": "<comments>",
         "enabled": true|false
     }
    

Response:

  • With valid BEARER token on success: 201 Created

    • Location: /platforms/:platform/auths/:auth_user_id
  • With valid BEARER token on failure due to conflicting user_id: 409 Conflict

    • Content-Location: /platforms/:platform/auths/:auth_user_id
    • Body:
      {
          "error": "Resource <:auth_user_id> already exists."
      }
      
  • With valid BEARER token on other failure: 400 Bad Request

    • Content Type: application/json
    • Body:
      {
          "error": "<Error Message>"
      }
      
  • With invalid BEARER token: 401 Unauthorized

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants