Class NullAuthorizationServiceClient
- Namespace
- FoundationaLLM.Common.Clients
- Assembly
- FoundationaLLM.Common.dll
Implements an authorization service that bypasses the Authorization API and allows all access by default.
public class NullAuthorizationServiceClient : IAuthorizationServiceClient
- Inheritance
-
NullAuthorizationServiceClient
- Implements
- Inherited Members
- Extension Methods
Methods
CreateRoleAssignment(string, RoleAssignmentRequest, UnifiedUserIdentity)
Creates a new role assignment.
public Task<RoleAssignmentOperationResult> CreateRoleAssignment(string instanceId, RoleAssignmentRequest roleAssignmentRequest, UnifiedUserIdentity userIdentity)
Parameters
instanceId
stringThe FoundationaLLM instance identifier.
roleAssignmentRequest
RoleAssignmentRequestThe RoleAssignmentRequest containing the details of the role assignment to be created.
userIdentity
UnifiedUserIdentityThe user identity.
Returns
- Task<RoleAssignmentOperationResult>
A RoleAssignmentOperationResult containing information about the result of the operation.
DeleteRoleAssignment(string, string, UnifiedUserIdentity)
Deletes a role assignment.
public Task<RoleAssignmentOperationResult> DeleteRoleAssignment(string instanceId, string roleAssignment, UnifiedUserIdentity userIdentity)
Parameters
instanceId
stringThe FoundationaLLM instance identifier.
roleAssignment
stringThe role assignment object identifier.
userIdentity
UnifiedUserIdentityThe user identity.
Returns
- Task<RoleAssignmentOperationResult>
A RoleAssignmentOperationResult containing information about the result of the operation.
DeleteSecretKey(string, string, string)
Deletes a specified secret key.
public Task DeleteSecretKey(string instanceId, string contextId, string secretKeyId)
Parameters
instanceId
stringThe FoundationaLLM instance identifier.
contextId
stringThe identifier of the context containing the secret key to delete.
secretKeyId
stringThe unique identifier of the secret key being deleted.
Returns
GetRoleAssignments(string, RoleAssignmentQueryParameters, UnifiedUserIdentity)
Returns a list of role assignments.
public Task<List<RoleAssignment>> GetRoleAssignments(string instanceId, RoleAssignmentQueryParameters queryParameters, UnifiedUserIdentity userIdentity)
Parameters
instanceId
stringThe FoundationaLLM instance identifier.
queryParameters
RoleAssignmentQueryParametersThe RoleAssignmentQueryParameters providing the inputs for filtering the role assignments.
userIdentity
UnifiedUserIdentityThe user identity.
Returns
- Task<List<RoleAssignment>>
The list of all role assignments for the specified instance.
GetSecretKeys(string, string)
Gets a list of SecretKey items that are associated with the specified instance and context.
public Task<List<SecretKey>> GetSecretKeys(string instanceId, string contextId)
Parameters
instanceId
stringThe FoundationaLLM instance identifier.
contextId
stringThe identifier of the context for which the secret keys are retrieved.
Returns
Remarks
Each consumer of secret keys should have a unique context identifier. For example, FoundationaLLM resource providers could use the resource object identifier as the context identifier.
ProcessAuthorizationRequest(string, string, List<string>, bool, bool, bool, UnifiedUserIdentity)
Processes an action authorization request.
public Task<ActionAuthorizationResult> ProcessAuthorizationRequest(string instanceId, string action, List<string> resourcePaths, bool expandResourceTypePaths, bool includeRoleAssignments, bool includeActions, UnifiedUserIdentity userIdentity)
Parameters
instanceId
stringThe FoundationaLLM instance id.
action
stringThe action identifier.
resourcePaths
List<string>The resource paths.
expandResourceTypePaths
boolA value indicating whether to expand resource type paths that are not authorized.
includeRoleAssignments
boolincludeActions
boolA value indicating whether to include authorizable actions in the response.
userIdentity
UnifiedUserIdentityThe user identity.
Returns
- Task<ActionAuthorizationResult>
An ActionAuthorizationResult containing the result of the processing.
Remarks
If the action specified by action
is not authorized for a resource type path,
and expandResourceTypePaths
is set to true
, the response will include
any authorized resource paths matching the resource type path.
If includeRoles
is set to true
, for each authrorized resource path,
the response will include the roles assigned directly or indirectly to the resource path.
If action
is set to true
, for each authorized resource path,
the response will include the autorizable actions assigned directly or indirectly to the resource path.
UpsertSecretKey(string, SecretKey)
Creates a new or updates an existing SecretKey item.
public Task<string?> UpsertSecretKey(string instanceId, SecretKey secretKey)
Parameters
instanceId
stringThe FoundationaLLM instance identifier.
secretKey
SecretKeyThe SecretKey item containing the properties of the secret key being created or updated.
Returns
- Task<string>
If the secret bey is being created, it returns the secret value of the key. Otherwise, returns
null
.
ValidateSecretKey(string, string, string)
Validates a secret key value.
public Task<SecretKeyValidationResult> ValidateSecretKey(string instanceId, string contextId, string secretKeyValue)
Parameters
instanceId
stringThe FoundationaLLM instance identifier.
contextId
stringThe identifier of the context containing the secret key to validate.
secretKeyValue
stringThe secret value of the key.
Returns
- Task<SecretKeyValidationResult>
A SecretKeyValidationResult item with the results of the validation.
Remarks
Each valid secret key has an associated virtual identity that is returned in the VirtualIdentity property. It is the responsibility of the caller to use the virtual identity to authorize the request.