@a-company/portal-core
v0.1.0
Published
Portal configuration parsing and validation
Maintainers
Readme
@a-company/portal-core
Portal configuration parsing and validation
Core library for working with portal.yaml files - the authorization topology format for defining access control rules.
Installation
npm install @a-company/portal-coreUsage
import {
parsePortalConfig,
validatePortalConfig,
findPortalFiles
} from '@a-company/portal-core';
// Find portal.yaml files
const files = await findPortalFiles('./');
// Parse a portal configuration
const config = await parsePortalConfig('./portal.yaml');
// Validate the configuration
const result = validatePortalConfig(config);
if (!result.valid) {
console.error(result.errors);
}Portal File Format
gates:
checkout:
description: Checkout flow access
requires:
- authenticated
- has_cart_items
signals:
- "!checkout-started"
- "!checkout-completed"
admin-panel:
description: Admin dashboard access
requires:
- authenticated
- role:adminDocumentation
See the main repository for full documentation.
License
MIT
