import '../node-crypto-polyfill.js'; import { REDOCLY_TEAMS_RBAC, REDOCLY_ROUTE_RBAC } from '@redocly/config'; import type { RbacConfig, RbacScopeItems, RedoclyConfig, SsoConfig } from '@redocly/config'; import type { AuthDetails } from '../types'; import type { ContentFs } from '../fs/content-fs.js'; import type { RbacFeatures } from '../../constants/common.js'; export type ProjectRole = 'NONE' | 'READ' | 'TRIAGE' | 'WRITE' | 'MAINTAIN' | 'ADMIN'; export declare const PROJECT_ROLES_ORDERED_BY_ACCESS_LEVEL: string[]; export declare function getHigherRole(a: ProjectRole, b: ProjectRole): ProjectRole; export declare function getScopeItemsForResource(rbacConfig: RbacConfig | undefined, resource: { fsPath?: string; slug?: string; }): RbacScopeItems; export declare function canAccessFeature(feature: RbacFeatures, auth: AuthDetails, rbacConfig?: RbacConfig, requiresLogin?: boolean): boolean; export declare function isResourcePubliclyAccessible(resource: { slug: string; [REDOCLY_TEAMS_RBAC]?: Record; }, config: RedoclyConfig): boolean; export declare function canAccessResource(resource: { slug?: string; [REDOCLY_TEAMS_RBAC]?: RbacScopeItems; [REDOCLY_ROUTE_RBAC]?: { slug?: string; fsPath?: string; }; }, user?: { isAuthenticated?: boolean; email?: string; teams?: string[]; }, rbacConfig?: RbacConfig, requiresLogin?: boolean): boolean; export declare function canDownloadApiDefinition(pathname: string, rbacConfig: RbacConfig, requiresLogin: boolean, user?: { isAuthenticated?: boolean; email?: string; teams?: string[]; }): boolean; export declare function canAccessAsset(pathname: string, rbacConfig: RbacConfig, requiresLogin: boolean, directoryPaths: Record, user?: { isAuthenticated?: boolean; email?: string; teams?: string[]; }): boolean; export declare function getAuthDetailsFromCookies(ssoConfig: SsoConfig, cookies: Record): Promise; /** * Maps the input deep and removes objects that have a 'permission' prop * but do not match the input permissions list * @param input can be object, array, string or any other value * @param user - user object with email and teams * @returns */ export declare function filterDataByAccessDeep(input: any, user?: { isAuthenticated?: boolean; email?: string; teams?: string[]; }, rbacConfig?: RbacConfig, requiresLogin?: boolean): any; export declare function parseTeamClaimToArray(claimValue: unknown): string[]; /** * Extends RBAC config rules to include all supported languages * */ export declare function applyL10nToRbacConfig(fs: ContentFs, rbacConfig: RbacConfig | undefined): RbacConfig | undefined; export declare function resolveDirectoryHashes(fs: ContentFs, rbacConfig: RbacConfig | undefined): Promise>; export declare const isRbacConfigValid: (rbacConfig: unknown) => boolean; export declare const parseRbacConfig: (rbacConfig: RbacConfig | undefined) => Promise; export declare const normalizeRbacConfig: (rbacConfig: RbacConfig) => { [x: string]: unknown; reunite?: { [x: string]: string; } | undefined; entitiesCatalog?: { catalogs?: { [x: string]: unknown; all?: { [x: string]: string; } | undefined; services?: { [x: string]: string; } | undefined; domains?: { [x: string]: string; } | undefined; teams?: { [x: string]: string; } | undefined; users?: { [x: string]: string; } | undefined; apiDescriptions?: { [x: string]: string; } | undefined; dataSchemas?: { [x: string]: string; } | undefined; apiOperations?: { [x: string]: string; } | undefined; } | undefined; entities?: { [x: string]: unknown; "**"?: { [x: string]: string; } | undefined; } | undefined; entitiesTypes?: { [x: string]: unknown; user?: { [x: string]: string; } | undefined; service?: { [x: string]: string; } | undefined; domain?: { [x: string]: string; } | undefined; team?: { [x: string]: string; } | undefined; apiDescription?: { [x: string]: string; } | undefined; apiOperation?: { [x: string]: string; } | undefined; dataSchema?: { [x: string]: string; } | undefined; } | undefined; entitiesGroups?: { entities?: string[] | undefined; config?: { [x: string]: string; } | undefined; }[] | undefined; } | undefined; content?: { [x: string]: unknown; "**"?: { [x: string]: string; } | undefined; } | undefined; teamNamePatterns?: string[] | undefined; teamFolders?: string[] | undefined; teamFoldersBaseRoles?: { [x: string]: string; } | undefined; cms?: { [x: string]: string; } | undefined; features?: { aiSearch?: { [x: string]: string; } | undefined; } | undefined; }; export declare function getRbacTeamsListForResource(resource: { fsPath?: string; slug?: string; }, rbacConfig: RbacConfig): string[]; export declare function extractTeamsFromScopeItems(scopeItems: RbacScopeItems | undefined): string[]; export declare function expandTeamsForRead(rbacConfig: RbacConfig, teamNames: string[]): string[]; //# sourceMappingURL=rbac.d.ts.map