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

GET /platforms/:platform/auths #37

Open
davidraker opened this issue Mar 7, 2022 · 1 comment
Open

GET /platforms/:platform/auths #37

davidraker opened this issue Mar 7, 2022 · 1 comment

Comments

@davidraker
Copy link
Contributor

davidraker commented Mar 7, 2022

Get routes for authentication/authorization records of all agents running in the VOLTTRON platform.

Request accepts the query parameter records which will cause the response to include auth records in addition to the routes.

If records is provided, and is True, the following boolean query parameters are also accepted to refine the contents of the response (True fields will be returned, while False fields will be excluded.):

domain, address, capabilities, roles, groups, mechanism, credentials, comments, enabled

If no query paramters are provided, all will be assumed to be True. If only False query parameters are provided, others will remain True. If any True query parameter is provided, however, all others not marked as True will be assumed to be False.

Note: <auth_user_id> can take any value specified in a user_id field in an auth record on the system. 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.

Request:

  • Authorization: BEARER <jwt_token>

Response:

  • With valid BEARER token on success: 200 OK
    • Content Type: application/json
    • Body (with record=false):
      {
          "route_options: {
                  "<auth_user_id>": "/platforms/:platform/auths/:auth_user_id",
                  "<auth_user_id>": "/platforms/:platform/auths/:auth_user_id"
          }
      }
      
    • Body (with records=true):
      {
          "<auth_user_id>": {
                  "route": "/platforms/:platform/auths/:auth_user_id",
                  "record": {
                      "domain": "<domain>",
                      "address": "<address>",
                      "capabilities": ["<capability>", ...],
                      "roles": ["<role>", ...],
                      "groups": ["<group>", ...],
                      "mechanism": "<mechanism>",
                      "credentials": "<public_key>",
                      "comments": "<comments>",
                      "enabled": true|false
              },
              {
                  "route": "/platforms/:platform/auths/:auth_user_id",
                  "record": {
                      "domain": "<domain>",
                       "address": "<address>",
                       "capabilities": ["<capability>", ...],
                       "roles": ["<role>", ...],
                       "groups": ["<group>", ...],
                       "mechanism": "<mechanism>",
                       "credentials": "<public_key>",
                       "comments": "<comments>",
                       "enabled": true|false
              }
          }
      }
      
  • With valid BEARER token on failure: 400 Bad Request
    • Content Type: application/json
    • Body:
      {
          "error": "<Error Message>"
      }
      
  • With invalid BEARER token: 401 Unauthorized
@davidraker
Copy link
Contributor Author

a.vip.rpc.call('platform.auth', 'auth_file.read').get()['allow_list']

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