Skip to content

Latest commit

 

History

History
262 lines (146 loc) · 8.81 KB

LocalQueriesApi.md

File metadata and controls

262 lines (146 loc) · 8.81 KB

\LocalQueriesApi

All URIs are relative to http://localhost

Method HTTP request Description
get_role_by_id_local_roles_role_id_get GET /local/roles/{role_id} Get Role By Id
get_role_by_name_local_roles_by_name_role_name_get GET /local/roles/by-name/{role_name} Get Role By Name
get_user_local_users_user_id_get GET /local/users/{user_id} Get User
get_user_permissions_local_users_user_id_permissions_get GET /local/users/{user_id}/permissions Get User Permissions
get_user_roles_local_users_user_id_roles_get GET /local/users/{user_id}/roles Get User Roles
get_user_tenants_local_users_user_id_tenants_get GET /local/users/{user_id}/tenants Get User Tenants
list_roles_local_roles_get GET /local/roles List Roles
list_users_local_users_get GET /local/users List Users

get_role_by_id_local_roles_role_id_get

models::SyncedRole get_role_by_id_local_roles_role_id_get(role_id, authorization) Get Role By Id

Get role (by the role id) directly from OPA cache. If role is not found, returns 404. Possible reasons are either: - role was never created via SDK or via the cloud console. - role was (very) recently created and the policy update did not propagate yet.

Parameters

Name Type Description Required Notes
role_id String [required]
authorization Option<serde_json::Value>

Return type

models::SyncedRole

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_role_by_name_local_roles_by_name_role_name_get

models::SyncedRole get_role_by_name_local_roles_by_name_role_name_get(role_name, authorization) Get Role By Name

Get role (by the role name - case sensitive) directly from OPA cache. If role is not found, returns 404. Possible reasons are either: - role with such name was never created via SDK or via the cloud console. - role was (very) recently created and the policy update did not propagate yet.

Parameters

Name Type Description Required Notes
role_name String [required]
authorization Option<serde_json::Value>

Return type

models::SyncedRole

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_user_local_users_user_id_get

models::SyncedUser get_user_local_users_user_id_get(user_id, authorization) Get User

Get user data directly from OPA cache. If user does not exist in OPA cache (i.e: not synced), returns 404.

Parameters

Name Type Description Required Notes
user_id String [required]
authorization Option<serde_json::Value>

Return type

models::SyncedUser

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_user_permissions_local_users_user_id_permissions_get

std::collections::HashMap<String, serde_json::Value> get_user_permissions_local_users_user_id_permissions_get(user_id, authorization) Get User Permissions

Get roles assigned to user directly from OPA cache. If user does not exist in OPA cache (i.e: not synced), returns 404.

Parameters

Name Type Description Required Notes
user_id String [required]
authorization Option<serde_json::Value>

Return type

std::collections::HashMap<String, serde_json::Value>

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_user_roles_local_users_user_id_roles_get

Vecmodels::SyncedRole get_user_roles_local_users_user_id_roles_get(user_id, authorization) Get User Roles

Get roles assigned to user directly from OPA cache. If user does not exist in OPA cache (i.e: not synced), returns 404.

Parameters

Name Type Description Required Notes
user_id String [required]
authorization Option<serde_json::Value>

Return type

Vecmodels::SyncedRole

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_user_tenants_local_users_user_id_tenants_get

Vec get_user_tenants_local_users_user_id_tenants_get(user_id, authorization) Get User Tenants

Get tenants assigned to user directly from OPA cache. This endpoint only returns tenants that the user has an assigned role in. i.e: if the user is assigned to tenant "tenant1" but has no roles in that tenant, "tenant1" will not be returned by this endpoint. If user does not exist in OPA cache (i.e: not synced), returns 404.

Parameters

Name Type Description Required Notes
user_id String [required]
authorization Option<serde_json::Value>

Return type

Vec

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list_roles_local_roles_get

Vecmodels::SyncedRole list_roles_local_roles_get(authorization) List Roles

Get all roles stored in OPA cache.

Parameters

Name Type Description Required Notes
authorization Option<serde_json::Value>

Return type

Vecmodels::SyncedRole

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list_users_local_users_get

Vecmodels::SyncedUser list_users_local_users_get(authorization) List Users

Get all users stored in OPA cache. Be advised, if you have many (i.e: few hundreds or more) users this query might be expensive latency-wise.

Parameters

Name Type Description Required Notes
authorization Option<serde_json::Value>

Return type

Vecmodels::SyncedUser

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]