|
|
|
|
@@ -1,5 +1,13 @@
|
|
|
|
|
import type { ApiSettings, DeltaDeletedItem, PrivacyRetentionPolicy, TenantAdminItem } from "@govoplan/core-webui";
|
|
|
|
|
import { apiFetch, apiGetList, apiPath, apiQuery } from "@govoplan/core-webui";
|
|
|
|
|
import type {
|
|
|
|
|
AccessDecisionProvenanceItem as CoreAccessDecisionProvenanceItem,
|
|
|
|
|
ApiSettings,
|
|
|
|
|
DeltaDeletedItem,
|
|
|
|
|
PrivacyRetentionPolicy,
|
|
|
|
|
ResourceAccessExplanationOptions,
|
|
|
|
|
ResourceAccessExplanationResponse as CoreResourceAccessExplanationResponse,
|
|
|
|
|
TenantAdminItem
|
|
|
|
|
} from "@govoplan/core-webui";
|
|
|
|
|
import { apiFetch, apiGetList, apiPath, apiQuery, fetchResourceAccessExplanation as fetchCoreResourceAccessExplanation } from "@govoplan/core-webui";
|
|
|
|
|
export { fetchAdminOverview, fetchPermissionCatalog, fetchTenants } from "@govoplan/core-webui";
|
|
|
|
|
export type {
|
|
|
|
|
AdminOverview,
|
|
|
|
|
@@ -101,12 +109,7 @@ export type AccessScopeExplanationItem = {
|
|
|
|
|
sources: AccessRoleSourceItem[];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type AccessDecisionProvenanceItem = {
|
|
|
|
|
kind: string;
|
|
|
|
|
id?: string | null;
|
|
|
|
|
label?: string | null;
|
|
|
|
|
tenant_id?: string | null;
|
|
|
|
|
source?: string | null;
|
|
|
|
|
export type AccessDecisionProvenanceItem = Omit<CoreAccessDecisionProvenanceItem, "details"> & {
|
|
|
|
|
details: Record<string, unknown>;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@@ -136,13 +139,7 @@ export type UserAccessExplanationResponse = {
|
|
|
|
|
function_facts: FunctionFactExplanationItem[];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type ResourceAccessExplanationResponse = {
|
|
|
|
|
user: UserAdminItem;
|
|
|
|
|
resource_type: string;
|
|
|
|
|
resource_id: string;
|
|
|
|
|
action: string;
|
|
|
|
|
provenance: AccessDecisionProvenanceItem[];
|
|
|
|
|
};
|
|
|
|
|
export type ResourceAccessExplanationResponse = CoreResourceAccessExplanationResponse<UserAdminItem, AccessDecisionProvenanceItem>;
|
|
|
|
|
|
|
|
|
|
export type SystemAccountItem = {
|
|
|
|
|
account_id: string;
|
|
|
|
|
@@ -356,15 +353,9 @@ export function fetchUserAccessExplanation(settings: ApiSettings, userId: string
|
|
|
|
|
|
|
|
|
|
export function fetchResourceAccessExplanation(
|
|
|
|
|
settings: ApiSettings,
|
|
|
|
|
options: { userId: string; resourceType: string; resourceId: string; action: string; tenantId?: string | null }
|
|
|
|
|
options: ResourceAccessExplanationOptions
|
|
|
|
|
): Promise<ResourceAccessExplanationResponse> {
|
|
|
|
|
return apiFetch(settings, apiPath("/api/v1/admin/access/resource-explanation", {
|
|
|
|
|
user_id: options.userId,
|
|
|
|
|
resource_type: options.resourceType,
|
|
|
|
|
resource_id: options.resourceId,
|
|
|
|
|
action: options.action,
|
|
|
|
|
tenant_id: options.tenantId
|
|
|
|
|
}));
|
|
|
|
|
return fetchCoreResourceAccessExplanation<UserAdminItem, AccessDecisionProvenanceItem>(settings, options);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function fetchGroups(settings: ApiSettings): Promise<GroupSummary[]> {
|
|
|
|
|
|