UNPKG

@theguild/federation-composition

Version:
25 lines 1.41 kB
import { type SelectionSetNode } from "graphql"; import type { SupergraphVisitorMap } from "../../composition/visitor.js"; import type { SupergraphState } from "../../state.js"; import type { SupergraphValidationContext } from "../validation-context.js"; import type { ObjectTypeFieldState, ObjectTypeState } from "../../composition/object-type.js"; import type { InterfaceTypeState } from "../../composition/interface-type.js"; import type { UnionTypeState } from "../../composition/union-type.js"; export declare function AuthOnRequiresRule(context: SupergraphValidationContext, supergraph: SupergraphState): SupergraphVisitorMap; type FieldCoordinate = `${string}.${string}`; type TypeCoordinate = `${string}`; type Coordinate = FieldCoordinate | TypeCoordinate; export declare function ensureAccessToSelectionSet(supergraph: SupergraphState, currentType: ObjectTypeState | InterfaceTypeState | UnionTypeState, selectionSet: SelectionSetNode, provisionedAccess: ProvisionedAccess): Coordinate | void; export declare class ProvisionedAccess { scopes: string[][]; policies: string[][]; authenticated: boolean; constructor(objectTypeState: ObjectTypeState, fieldState: ObjectTypeFieldState); canAccess(required: { authenticated: boolean; policies: string[][]; scopes: string[][]; }): boolean; } export {}; //# sourceMappingURL=auth-on-requires-rule.d.ts.map