Interface IAuthorizationCore
- Namespace
 - FoundationaLLM.AuthorizationEngine.Interfaces
 
- Assembly
 - FoundationaLLM.AuthorizationEngine.dll
 
Defines the methods for authorization core.
public interface IAuthorizationCore
  - Extension Methods
 
Methods
AllowAuthorizationRequestsProcessing(string, string)
Checks if a specified security principal is allowed to process authorization requests.
bool AllowAuthorizationRequestsProcessing(string instanceId, string securityPrincipalId)
  Parameters
instanceIdstringThe FoundationaLLM instance id.
securityPrincipalIdstringThe id of the security principal whose authorization is checked.
Returns
- bool
 True if the security principal is allowed to process authorization requests.
CreateRoleAssignment(string, RoleAssignmentCreateRequest)
Creates a role assignment for a specified security principal.
Task<RoleAssignmentOperationResult> CreateRoleAssignment(string instanceId, RoleAssignmentCreateRequest roleAssignmentCreateRequest)
  Parameters
instanceIdstringThe FoundationaLLM instance identifier.
roleAssignmentCreateRequestRoleAssignmentCreateRequestThe role assignment create request.
Returns
- Task<RoleAssignmentOperationResult>
 The role assignment result.
DeleteRoleAssignment(string, string)
Revokes a role from an Entra ID user or group.
Task<RoleAssignmentOperationResult> DeleteRoleAssignment(string instanceId, string roleAssignmentName)
  Parameters
instanceIdstringThe FoundationaLLM instance identifier.
roleAssignmentNamestringThe unique name of the role assignment to delete.
Returns
- Task<RoleAssignmentOperationResult>
 The role assignment result.
DeleteSecretKey(string, string, string)
Deletes a specified secret key.
Task DeleteSecretKey(string instanceId, string contextId, string secretKeyId)
  Parameters
instanceIdstringThe FoundationaLLM instance identifier.
contextIdstringThe identifier of the context containing the secret key to delete.
secretKeyIdstringThe unique identifier of the secret key being deleted.
Returns
GetRoleAssignments(string, RoleAssignmentQueryParameters)
Returns a list of role assignments for the specified instance and resource path.
List<RoleAssignment> GetRoleAssignments(string instanceId, RoleAssignmentQueryParameters queryParameters)
  Parameters
instanceIdstringThe FoundationaLLM instance identifier.
queryParametersRoleAssignmentQueryParametersThe RoleAssignmentQueryParameters providing the inputs for filtering the role assignments.
Returns
- 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.
List<SecretKey> GetSecretKeys(string instanceId, string contextId)
  Parameters
instanceIdstringThe FoundationaLLM instance identifier.
contextIdstringThe 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, ActionAuthorizationRequest)
Processes an authorization request.
ActionAuthorizationResult ProcessAuthorizationRequest(string instanceId, ActionAuthorizationRequest authorizationRequest)
  Parameters
instanceIdstringThe FoundationaLLM instance id.
authorizationRequestActionAuthorizationRequestThe ActionAuthorizationRequest containing the details of the authorization request.
Returns
- ActionAuthorizationResult
 An ActionAuthorizationResult indicating whether the requested authorization was successfull or not for each resource path.
UpsertSecretKey(string, SecretKey)
Creates a new or updates an existing SecretKey item.
Task<string?> UpsertSecretKey(string instanceId, SecretKey secretKey)
  Parameters
instanceIdstringThe FoundationaLLM instance identifier.
secretKeySecretKeyThe SecretKey item containing the properties of the secret key being created or updated.
Returns
- Task<string>
 If the secret key is being created, it returns the secret value of the key. Otherwise, returns
null.
ValidateSecretKey(ClientSecretKey)
Validates a secret key value.
Task<SecretKeyValidationResult> ValidateSecretKey(ClientSecretKey clientSecretKey)
  Parameters
clientSecretKeyClientSecretKeyThe ClientSecretKey containing the secret key value to validate.
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.