Table of Contents

Class ResourcePathUtils

Namespace
FoundationaLLM.Common.Utils
Assembly
FoundationaLLM.Common.dll

Utilities dedicated to the ResourcePath class.

public static class ResourcePathUtils
Inheritance
ResourcePathUtils
Inherited Members

Methods

ParseForAuthorizationRequestResourcePath(string, List<string>)

Parses a resource path from an ActionAuthorizationRequest object.

public static ResourcePath ParseForAuthorizationRequestResourcePath(string resourcePath, List<string> allowedInstanceIds)

Parameters

resourcePath string

The resource path to be analyzed.

allowedInstanceIds List<string>

The list of allowed FoundationaLLM instance identifiers.

Returns

ResourcePath

A ResourcePath instance.

Exceptions

AuthorizationException

Thrown if the resource path is invalid.

ParseForPolicyAssignmentScope(string, List<string>)

Parses a resource path used as scope for a PBAC policy assignment.

public static ResourcePath ParseForPolicyAssignmentScope(string resourcePath, List<string> allowedInstanceIds)

Parameters

resourcePath string

The resource path to be parsed.

allowedInstanceIds List<string>

The list of FoundationaLLM instance identifiers used as the context for parsing.

Returns

ResourcePath

A ResourcePath object containing the parsed resource path.

Remarks

Resource paths used as scopes for policy assignments must be valid resource type paths. If the resource path is not a valid resource type path, the method will throw an exception.

Also, all resource paths must reference one of the allowed FoundationaLLM instance identifiers.

Exceptions

AuthorizationException

ParseForRoleAssignmentScope(string, List<string>)

Parses a resource path used as scope for an RBAC role assignment.

public static ResourcePath ParseForRoleAssignmentScope(string resourcePath, List<string> allowedInstanceIds)

Parameters

resourcePath string

The resource path to be parsed.

allowedInstanceIds List<string>

The list of FoundationaLLM instance identifiers used as the context for parsing.

Returns

ResourcePath

A ResourcePath object containing the parsed resource path.

Remarks

Technically, the resource path can be any valid resource path, including a root path. At the moment, role assignments are not allowed at the root level, so the method will throw an exception if the resource path is a root path. Role assignments at the root level are reserved for future use (e.g., in SaaS scenarios where cross-FoundationaLLM instance assignments are needed).

Any non-root resource path must reference one of the allowed FoundationaLLM instance identifiers.

Exceptions

AuthorizationException