provenaclient.modules.auth
Created Date: Friday May 31st 2024 +1000 Author: Peter Baker —– Last Modified: Friday May 31st 2024 9:50:26 am +1000 Modified By: Peter Baker —– Description: Auth API L3 Module. —– HISTORY: Date By Comments ———- — ———————————————————
Classes
This class interface just captures that the client has an instantiated auth |
|
This class interface just captures that the client has an instantiated auth |
Module Contents
- class provenaclient.modules.auth.AdminAuthSubModule(auth: provenaclient.modules.module_helpers.AuthManager, config: provenaclient.modules.module_helpers.Config, auth_client: provenaclient.clients.AuthClient)[source]
Bases:
provenaclient.modules.module_helpers.ModuleService
This class interface just captures that the client has an instantiated auth manager which allows for helper functions abstracted for L3 clients.
- _auth_client: provenaclient.clients.AuthClient
- _auth
- _config
- async get_all_pending_request_history() ProvenaInterfaces.AuthAPI.AccessRequestList [source]
Gets all requests with pending status
- Returns:
The response object
- Return type:
AccessRequestList
- async get_all_request_history() ProvenaInterfaces.AuthAPI.AccessRequestList [source]
Gets all requests
- Returns:
The response object
- Return type:
AccessRequestList
- async get_user_pending_request_history(username: str) ProvenaInterfaces.AuthAPI.AccessRequestList [source]
Gets pending requests for specified user
- Parameters:
username (str) – Username to query
- Returns:
The response list
- Return type:
AccessRequestList
- async get_user_request_history(username: str) ProvenaInterfaces.AuthAPI.AccessRequestList [source]
Gets all requests for specified user
- Parameters:
username (str) – Username to query
- Returns:
The response list
- Return type:
AccessRequestList
- async post_add_note(note: ProvenaInterfaces.AuthAPI.RequestAddNote) None [source]
Adds a note to an existing request
- Parameters:
note (RequestAddNote) – Payload incl note info
- async post_change_request_state(send_email_alert: bool, change: ProvenaInterfaces.AuthAPI.AccessRequestStatusChange) ProvenaInterfaces.AuthAPI.ChangeStateStatus [source]
Change state of a request.
- Parameters:
send_email_alert (bool) – Should trigger email alert?
change (AccessRequestStatusChange) – The details of change
- Returns:
The response object
- Return type:
ChangeStateStatus
- async get_list_groups() ProvenaInterfaces.AuthAPI.ListGroupsResponse [source]
Gets a list of groups
- Returns:
List of groups
- Return type:
ListGroupsResponse
- async get_describe_group(group_id: str) ProvenaInterfaces.AuthAPI.DescribeGroupResponse [source]
Describes a group by ID
- Parameters:
group_id (str) – The group
- Returns:
Description
- Return type:
DescribeGroupResponse
- async get_list_members(group_id: str) ProvenaInterfaces.AuthAPI.ListMembersResponse [source]
Lists members of group
- Parameters:
group_id (str) – The gruop
- Returns:
The list of members
- Return type:
ListMembersResponse
- async get_list_group_membership(username: str) ProvenaInterfaces.AuthAPI.ListUserMembershipResponse [source]
Gets list of groups a user is in
- Parameters:
username (str) – The username
- Returns:
The list of groups
- Return type:
ListUserMembershipResponse
- async get_check_user_membership(username: str, group_id: str) ProvenaInterfaces.AuthAPI.CheckMembershipResponse [source]
Checks user membership within a group
- Parameters:
username (str) – The username to target
group_id (str) – The group to check
- Returns:
Response
- Return type:
CheckMembershipResponse
- async post_groups_add_member(group_id: str, user: ProvenaInterfaces.AuthAPI.GroupUser) ProvenaInterfaces.AuthAPI.AddMemberResponse [source]
Adds a member to a group
- Parameters:
group_id (str) – Id of group
user (GroupUser) – The user to add
- Returns:
The response
- Return type:
AddMemberResponse
- async delete_remove_member(group_id: str, username: str) ProvenaInterfaces.AuthAPI.RemoveMemberResponse [source]
Removes member from group
- Parameters:
group_id (str) – The id of group
username (str) – The user to remove
- Returns:
The response
- Return type:
RemoveMemberResponse
- async post_add_group(group: ProvenaInterfaces.AuthAPI.UserGroupMetadata) ProvenaInterfaces.AuthAPI.AddGroupResponse [source]
Adds a group/creates group
- Parameters:
group (UserGroupMetadata) – The group details
- Returns:
The response
- Return type:
AddGroupResponse
- async put_update_group(group: ProvenaInterfaces.AuthAPI.UserGroupMetadata) ProvenaInterfaces.AuthAPI.UpdateGroupResponse [source]
Updates group details
- Parameters:
group (UserGroupMetadata) – The group metadata
- Returns:
The response
- Return type:
UpdateGroupResponse
- async get_export_groups() ProvenaInterfaces.AuthAPI.GroupsExportResponse [source]
Exports all group details in specified format.
- Returns:
The data dump
- Return type:
GroupsExportResponse
- async post_import_groups(body: ProvenaInterfaces.AuthAPI.GroupsImportRequest) ProvenaInterfaces.AuthAPI.GroupsImportResponse [source]
Imports groups from data dump back in
- Parameters:
body (GroupsImportRequest) – The import request incl. dump
- Returns:
The response
- Return type:
GroupsImportResponse
- async post_restore_groups_from_table(table_name: str, body: ProvenaInterfaces.AuthAPI.GroupsRestoreRequest) ProvenaInterfaces.AuthAPI.GroupsImportResponse [source]
Restores groups by first dumping from valid group table. Needs permissions to table.
- Parameters:
table_name (str) – The table name
body (GroupsRestoreRequest) – The request
- Returns:
The response details
- Return type:
GroupsImportResponse
- async get_link_lookup_username(username: str) ProvenaInterfaces.AuthAPI.AdminLinkUserLookupResponse [source]
Gets the linked person for user
- Parameters:
username (str) – User to lookup
- Returns:
Response
- Return type:
AdminLinkUserLookupResponse
- async get_link_reverse_lookup_username(person_id: str) ProvenaInterfaces.AuthAPI.UserLinkReverseLookupResponse [source]
Looks up reverse by person ID
- Parameters:
person_id (str) – The person to lookup
- Returns:
The response
- Return type:
UserLinkReverseLookupResponse
- async post_link_assign(body: ProvenaInterfaces.AuthAPI.AdminLinkUserAssignRequest) ProvenaInterfaces.AuthAPI.AdminLinkUserAssignResponse [source]
Assigns a person to a given user
- Parameters:
body (AdminLinkUserAssignRequest) – The request
- Returns:
The response
- Return type:
AdminLinkUserAssignResponse
- class provenaclient.modules.auth.Auth(auth: provenaclient.modules.module_helpers.AuthManager, config: provenaclient.modules.module_helpers.Config, auth_client: provenaclient.clients.AuthClient)[source]
Bases:
provenaclient.modules.module_helpers.ModuleService
This class interface just captures that the client has an instantiated auth manager which allows for helper functions abstracted for L3 clients.
- _auth_client: provenaclient.clients.AuthClient
- admin: AdminAuthSubModule
- _auth
- _config
- async get_health_check() provenaclient.models.HealthCheckResponse [source]
Health check the API
- Returns:
Response
- Return type:
- async get_user_request_history() ProvenaInterfaces.AuthAPI.AccessRequestList [source]
Gets the users access request history
- Returns:
The list of requests
- Return type:
AccessRequestList
- async post_user_request_change(body: ProvenaInterfaces.AuthAPI.AccessReport, send_email: bool) ProvenaInterfaces.AuthAPI.StatusResponse [source]
Requests a change by diffing access models
- Parameters:
body (AccessReport) – The new access desired
send_email (bool) – Email alert
- Returns:
Ok?
- Return type:
StatusResponse
- async get_user_pending_request_history() ProvenaInterfaces.AuthAPI.AccessRequestList [source]
Gets only pending requests from history
- Returns:
The list
- Return type:
AccessRequestList
- async get_user_generate_access_report() ProvenaInterfaces.AuthAPI.AccessReportResponse [source]
Generates an access report detailing system access.
- Returns:
The response
- Return type:
AccessReportResponse
- async get_list_groups() ProvenaInterfaces.AuthAPI.ListGroupsResponse [source]
Lists all groups
- Returns:
List of groups
- Return type:
ListGroupsResponse
- async get_describe_group(group_id: str) ProvenaInterfaces.AuthAPI.DescribeGroupResponse [source]
Describes a specific gruop
- Parameters:
group_id (str) – The id of group
- Returns:
Response with details
- Return type:
DescribeGroupResponse
- async get_list_membership() ProvenaInterfaces.AuthAPI.ListUserMembershipResponse [source]
Gets the list of groups user is member of
- Returns:
List and details
- Return type:
ListUserMembershipResponse
- async get_list_group_members(group_id: str) ProvenaInterfaces.AuthAPI.ListMembersResponse [source]
Lists the members of a given group
- Parameters:
group_id (str) – The group to lookup
- Returns:
Members
- Return type:
ListMembersResponse
- async get_check_membership(group_id: str) ProvenaInterfaces.AuthAPI.CheckMembershipResponse [source]
Checks if user is in specific group
- Parameters:
group_id (str) – The group to check
- Returns:
In group?
- Return type:
CheckMembershipResponse
- async get_link_lookup_username(username: ProvenaInterfaces.AuthAPI.Optional[str] = None) ProvenaInterfaces.AuthAPI.UserLinkUserLookupResponse [source]
Looks up either current user or specified user
- Parameters:
username (Optional[str], optional) – The username if not current user. Defaults to None.
- Returns:
The response indicating link
- Return type:
UserLinkUserLookupResponse
- async post_link_assign(body: ProvenaInterfaces.AuthAPI.UserLinkUserAssignRequest) ProvenaInterfaces.AuthAPI.UserLinkUserAssignResponse [source]
Assigns link to current user.
- Parameters:
body (UserLinkUserAssignRequest) – The link to assign
- Returns:
The response indicating success
- Return type:
UserLinkUserAssignResponse
- async post_link_validate(body: ProvenaInterfaces.AuthAPI.UserLinkUserAssignRequest) ProvenaInterfaces.AuthAPI.UserLinkUserValidateResponse [source]
Validates link before making it.
- Parameters:
body (UserLinkUserAssignRequest) – The link to assign
- Returns:
Valid?
- Return type:
UserLinkUserValidateResponse