@jwilleke/ngdpbase-types 0.0.0 → 5.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +16 -2
- package/lib/packages/ngdpbase-types/index.d.ts +32 -0
- package/lib/packages/ngdpbase-types/testing.d.ts +43 -0
- package/lib/packages/ngdpbase-types/testing.js +53 -0
- package/lib/src/cache/CacheDependencies.d.ts +50 -0
- package/lib/src/cache/CacheDependencies.js +50 -0
- package/lib/src/cache/ICacheAdapter.d.ts +86 -0
- package/lib/src/cache/RegionCache.d.ts +171 -0
- package/lib/src/context/ActorContext.d.ts +48 -0
- package/lib/src/context/ActorContext.js +33 -0
- package/lib/src/context/ApiContext.d.ts +194 -0
- package/lib/src/context/ApiContext.js +273 -0
- package/lib/src/context/BaseContext.d.ts +110 -0
- package/lib/src/context/BaseContext.js +143 -0
- package/lib/src/context/JobContext.d.ts +153 -0
- package/lib/src/context/JobContext.js +144 -0
- package/lib/src/context/WikiContext.d.ts +404 -0
- package/lib/src/context/bootActions.d.ts +64 -0
- package/lib/src/context/bootActions.js +111 -0
- package/lib/src/converters/HtmlConverter.d.ts +70 -0
- package/lib/src/converters/IContentConverter.d.ts +94 -0
- package/lib/src/converters/JSPWikiConverter.d.ts +117 -0
- package/lib/src/converters/conversionWarning.d.ts +15 -0
- package/lib/src/converters/ncm/bridge.d.ts +22 -0
- package/lib/src/converters/ncm/existing.d.ts +23 -0
- package/lib/src/converters/ncm/fix/blocks.d.ts +89 -0
- package/lib/src/converters/ncm/fix/bulletMarkers.d.ts +21 -0
- package/lib/src/converters/ncm/fix/index.d.ts +36 -0
- package/lib/src/converters/ncm/fix/jspwikiBullets.d.ts +20 -0
- package/lib/src/converters/ncm/fix/jspwikiCodeMarkers.d.ts +38 -0
- package/lib/src/converters/ncm/fix/jspwikiHeadings.d.ts +25 -0
- package/lib/src/converters/ncm/fix/jspwikiIndent.d.ts +24 -0
- package/lib/src/converters/ncm/fix/jspwikiInsert.d.ts +21 -0
- package/lib/src/converters/ncm/fix/jspwikiItalic.d.ts +29 -0
- package/lib/src/converters/ncm/fix/jspwikiLinkLeftovers.d.ts +27 -0
- package/lib/src/converters/ncm/fix/moreInformationFooter.d.ts +25 -0
- package/lib/src/converters/ncm/fix/styleClosers.d.ts +25 -0
- package/lib/src/converters/ncm/fix/tightenLists.d.ts +30 -0
- package/lib/src/converters/ncm/fix/types.d.ts +33 -0
- package/lib/src/converters/ncm/footnotes.d.ts +39 -0
- package/lib/src/converters/ncm/images.d.ts +49 -0
- package/lib/src/converters/ncm/index.d.ts +20 -0
- package/lib/src/converters/ncm/links.d.ts +21 -0
- package/lib/src/converters/ncm/normalize.d.ts +39 -0
- package/lib/src/converters/ncm/placeholder.d.ts +25 -0
- package/lib/src/converters/ncm/tables.d.ts +36 -0
- package/lib/src/converters/ncm/types.d.ts +42 -0
- package/lib/src/http/egressPolicy.d.ts +52 -0
- package/lib/src/http/guardedFetch.d.ts +89 -0
- package/lib/src/http/guardedFetch.js +113 -0
- package/lib/src/http/guardedLookup.d.ts +48 -0
- package/lib/src/http/guardedLookup.js +73 -0
- package/lib/src/http/ssrf.d.ts +83 -0
- package/lib/src/http/ssrf.js +311 -0
- package/lib/src/mail/MailProvider.d.ts +36 -0
- package/lib/src/mail/NodemailerMailProvider.d.ts +26 -0
- package/lib/src/managers/AddonsManager.d.ts +691 -0
- package/lib/src/managers/AgentTokenManager.d.ts +269 -0
- package/lib/src/managers/AssetManager.d.ts +116 -0
- package/lib/src/managers/AttachmentManager.d.ts +1032 -0
- package/lib/src/managers/AuthManager.d.ts +1257 -0
- package/lib/src/managers/BackgroundJobManager.d.ts +434 -0
- package/lib/src/managers/BaseManager.d.ts +391 -0
- package/lib/src/managers/BaseManager.js +415 -0
- package/lib/src/managers/CacheManager.d.ts +159 -0
- package/lib/src/managers/CatalogManager.d.ts +235 -0
- package/lib/src/managers/CommentManager.d.ts +75 -0
- package/lib/src/managers/ConfigurationManager.d.ts +747 -0
- package/lib/src/managers/DatabaseManager.d.ts +89 -0
- package/lib/src/managers/DatabaseManager.js +236 -0
- package/lib/src/managers/EmailManager.d.ts +47 -0
- package/lib/src/managers/ExportManager.d.ts +129 -0
- package/lib/src/managers/ExportManager.js +420 -0
- package/lib/src/managers/FootnoteManager.d.ts +118 -0
- package/lib/src/managers/MediaManager.d.ts +279 -0
- package/lib/src/managers/MetricsManager.d.ts +89 -0
- package/lib/src/managers/NotificationManager.d.ts +165 -0
- package/lib/src/managers/OidcManager.d.ts +210 -0
- package/lib/src/managers/OrganizationManager.d.ts +107 -0
- package/lib/src/managers/PageManager.d.ts +1645 -0
- package/lib/src/managers/PersonManager.d.ts +48 -0
- package/lib/src/managers/PluginManager.d.ts +179 -0
- package/lib/src/managers/PluginManager.js +393 -0
- package/lib/src/managers/PolicyEvaluator.d.ts +213 -0
- package/lib/src/managers/RenderingManager.d.ts +358 -0
- package/lib/src/managers/RoleManager.d.ts +134 -0
- package/lib/src/managers/SearchManager.d.ts +402 -0
- package/lib/src/managers/ShareManager.d.ts +251 -0
- package/lib/src/managers/TemplateManager.d.ts +176 -0
- package/lib/src/managers/ThemeManager.d.ts +56 -0
- package/lib/src/managers/UserManager.d.ts +480 -0
- package/lib/src/managers/ValidationManager.d.ts +426 -0
- package/lib/src/managers/VariableManager.d.ts +145 -0
- package/lib/src/middleware/csrf.d.ts +3 -0
- package/lib/src/parsers/LinkParser.d.ts +457 -0
- package/lib/src/parsers/MarkupParser.d.ts +769 -0
- package/lib/src/parsers/context/ParseContext.d.ts +314 -0
- package/lib/src/parsers/data/emoji-map.d.ts +18 -0
- package/lib/src/parsers/dom/DOMBuilder.d.ts +210 -0
- package/lib/src/parsers/dom/DOMParser.d.ts +252 -0
- package/lib/src/parsers/dom/Tokenizer.d.ts +358 -0
- package/lib/src/parsers/dom/WikiDocument.d.ts +272 -0
- package/lib/src/parsers/dom/handlers/DOMLinkHandler.d.ts +260 -0
- package/lib/src/parsers/dom/handlers/DOMPluginHandler.d.ts +212 -0
- package/lib/src/parsers/dom/handlers/DOMVariableHandler.d.ts +171 -0
- package/lib/src/parsers/filters/BaseFilter.d.ts +269 -0
- package/lib/src/parsers/filters/FilterChain.d.ts +320 -0
- package/lib/src/parsers/handlers/BaseSyntaxHandler.d.ts +331 -0
- package/lib/src/parsers/handlers/HandlerRegistry.d.ts +225 -0
- package/lib/src/parsers/handlers/JSPWikiPreprocessor.d.ts +89 -0
- package/lib/src/parsers/handlers/LinkParserHandler.d.ts +80 -0
- package/lib/src/parsers/handlers/PluginSyntaxHandler.d.ts +78 -0
- package/lib/src/parsers/handlers/WikiFormHandler.d.ts +149 -0
- package/lib/src/parsers/handlers/WikiTagHandler.d.ts +125 -0
- package/lib/src/parsers/jspwikiTableRow.d.ts +39 -0
- package/lib/src/parsers/styleBlockSyntax.d.ts +14 -0
- package/lib/src/plugins/types.d.ts +79 -0
- package/lib/src/providers/AgentTokenAuthProvider.d.ts +40 -0
- package/lib/src/providers/AuthentikBearerAuthProvider.d.ts +75 -0
- package/lib/src/providers/BaseAttachmentProvider.d.ts +197 -0
- package/lib/src/providers/BaseAuthProvider.d.ts +220 -0
- package/lib/src/providers/BaseCacheProvider.d.ts +140 -0
- package/lib/src/providers/BaseCredentialsProvider.d.ts +84 -0
- package/lib/src/providers/BaseDatabaseProvider.d.ts +22 -0
- package/lib/src/providers/BaseDatabaseProvider.js +12 -0
- package/lib/src/providers/BaseLoggingProvider.d.ts +68 -0
- package/lib/src/providers/BaseLoggingProvider.js +37 -0
- package/lib/src/providers/BaseMediaProvider.d.ts +308 -0
- package/lib/src/providers/BasePageProvider.d.ts +337 -0
- package/lib/src/providers/BaseProvider.d.ts +98 -0
- package/lib/src/providers/BaseProvider.js +74 -0
- package/lib/src/providers/BaseSearchProvider.d.ts +362 -0
- package/lib/src/providers/BasicAttachmentProvider.d.ts +599 -0
- package/lib/src/providers/CloudflareAccessAuthProvider.d.ts +72 -0
- package/lib/src/providers/FileCredentialsProvider.d.ts +33 -0
- package/lib/src/providers/FileJobStateProvider.d.ts +58 -0
- package/lib/src/providers/FileLoggingProvider.d.ts +43 -0
- package/lib/src/providers/FileLoggingProvider.js +120 -0
- package/lib/src/providers/FileOidcAdapter.d.ts +25 -0
- package/lib/src/providers/FileSystemMediaProvider.d.ts +403 -0
- package/lib/src/providers/LunrSearchProvider.d.ts +280 -0
- package/lib/src/providers/MagicLinkAuthProvider.d.ts +125 -0
- package/lib/src/providers/NullCacheProvider.d.ts +72 -0
- package/lib/src/providers/OidcAuthProvider.d.ts +180 -0
- package/lib/src/providers/OidcBearerAuthProvider.d.ts +30 -0
- package/lib/src/providers/PasskeyAuthProvider.d.ts +58 -0
- package/lib/src/providers/PasswordAuthProvider.d.ts +20 -0
- package/lib/src/providers/SqliteDatabaseProvider.d.ts +55 -0
- package/lib/src/providers/SqliteDatabaseProvider.js +90 -0
- package/lib/src/providers/SqliteJobStateProvider.d.ts +41 -0
- package/lib/src/providers/databaseMigrations.d.ts +8 -0
- package/lib/src/providers/databaseMigrations.js +47 -0
- package/lib/src/providers/jobState.d.ts +99 -0
- package/lib/src/providers/lunrQueryToMiniSearch.d.ts +32 -0
- package/lib/src/providers/mediaFilenameDate.d.ts +22 -0
- package/lib/src/providers/sqliteLocation.d.ts +17 -0
- package/lib/src/providers/sqliteLocation.js +55 -0
- package/lib/src/providers/sqliteMigrations.d.ts +48 -0
- package/lib/src/providers/sqliteMigrations.js +72 -0
- package/lib/src/rendering/githubAlerts.d.ts +22 -0
- package/lib/src/rendering/htmlPolicy.d.ts +76 -0
- package/lib/src/rendering/markdownConverter.d.ts +73 -0
- package/lib/src/security/PolicyDecisionPoint.d.ts +245 -0
- package/lib/src/security/PolicyInformationPoint.d.ts +448 -0
- package/lib/src/security/pageActions.d.ts +40 -0
- package/lib/src/security/permissions.generated.d.ts +78 -0
- package/lib/src/types/Asset.d.ts +414 -0
- package/lib/src/types/Catalog.d.ts +61 -0
- package/lib/src/types/Comment.d.ts +11 -0
- package/lib/src/types/Config.d.ts +388 -0
- package/lib/src/types/Organization.d.ts +78 -0
- package/lib/src/types/OrganizationProvider.d.ts +38 -0
- package/lib/src/types/Page.d.ts +220 -0
- package/lib/src/types/Person.d.ts +56 -0
- package/lib/src/types/PersonProvider.d.ts +25 -0
- package/lib/src/types/Policy.d.ts +139 -0
- package/lib/src/types/Policy.js +17 -0
- package/lib/src/types/Provider.d.ts +810 -0
- package/lib/src/types/Role.d.ts +84 -0
- package/lib/src/types/RoleProvider.d.ts +35 -0
- package/lib/src/types/Schema.d.ts +425 -0
- package/lib/src/types/Share.d.ts +172 -0
- package/lib/src/types/Share.js +81 -0
- package/lib/src/types/User.d.ts +304 -0
- package/lib/src/types/Version.d.ts +189 -0
- package/lib/src/types/WikiEngine.d.ts +128 -0
- package/lib/src/types/express.d.ts +120 -0
- package/lib/src/types/express.js +1 -0
- package/lib/src/types/guards.d.ts +78 -0
- package/lib/src/types/heic-decode.d.ts +16 -0
- package/lib/src/types/index.d.ts +19 -0
- package/lib/src/types/linkedom.d.ts +77 -0
- package/lib/src/types/markdown-it-plugins.d.ts +21 -0
- package/lib/src/utils/DeltaStorage.d.ts +118 -0
- package/lib/src/utils/LocaleUtils.d.ts +105 -0
- package/lib/src/utils/LocaleUtils.js +294 -0
- package/lib/src/utils/PageNameMatcher.d.ts +98 -0
- package/lib/src/utils/PathPreflight.d.ts +38 -0
- package/lib/src/utils/PathPreflight.js +50 -0
- package/lib/src/utils/SectionUtils.d.ts +40 -0
- package/lib/src/utils/addonConfigLayer.d.ts +144 -0
- package/lib/src/utils/addonConfigLayer.js +382 -0
- package/lib/src/utils/addonDatabaseRules.d.ts +25 -0
- package/lib/src/utils/addonDatabaseRules.js +57 -0
- package/lib/src/utils/addonHost.d.ts +51 -0
- package/lib/src/utils/addonHost.js +72 -0
- package/lib/src/utils/addonInstaller.d.ts +109 -0
- package/lib/src/utils/addonLock.d.ts +37 -0
- package/lib/src/utils/addonLock.js +48 -0
- package/lib/src/utils/addonPageSync.d.ts +45 -0
- package/lib/src/utils/addonProvenance.d.ts +48 -0
- package/lib/src/utils/addonTarball.d.ts +41 -0
- package/lib/src/utils/addonsPathResolver.d.ts +76 -0
- package/lib/src/utils/addonsPathResolver.js +129 -0
- package/lib/src/utils/assetMetadataTags.d.ts +66 -0
- package/lib/src/utils/atomicWrite.d.ts +28 -0
- package/lib/src/utils/auditConfigChange.d.ts +57 -0
- package/lib/src/utils/auditEventNames.d.ts +50 -0
- package/lib/src/utils/auditEventNames.generated.d.ts +163 -0
- package/lib/src/utils/auditEventNames.generated.js +168 -0
- package/lib/src/utils/auditEventNames.js +49 -0
- package/lib/src/utils/auditEvents.d.ts +265 -0
- package/lib/src/utils/auditEvents.js +309 -0
- package/lib/src/utils/auditRegistry.d.ts +102 -0
- package/lib/src/utils/auditRegistry.js +168 -0
- package/lib/src/utils/bip39English.d.ts +2 -0
- package/lib/src/utils/configEnvKeys.d.ts +68 -0
- package/lib/src/utils/configFiles.d.ts +74 -0
- package/lib/src/utils/configFiles.js +150 -0
- package/lib/src/utils/delegation.d.ts +48 -0
- package/lib/src/utils/deriveUsername.d.ts +21 -0
- package/lib/src/utils/explainMediaPath.d.ts +123 -0
- package/lib/src/utils/formerTitles.d.ts +69 -0
- package/lib/src/utils/frontmatterAccess.d.ts +54 -0
- package/lib/src/utils/headlessAdminPassword.d.ts +55 -0
- package/lib/src/utils/imageTransform.d.ts +52 -0
- package/lib/src/utils/instanceEnvSecret.d.ts +51 -0
- package/lib/src/utils/jobSlots.d.ts +43 -0
- package/lib/src/utils/keywordNormalizer.d.ts +127 -0
- package/lib/src/utils/logger.d.ts +70 -0
- package/lib/src/utils/logger.js +106 -0
- package/lib/src/utils/magicLinkDeviceState.d.ts +95 -0
- package/lib/src/utils/managerUtils.d.ts +40 -0
- package/lib/src/utils/migrateLegacyPrivateAttachments.d.ts +15 -0
- package/lib/src/utils/orgFilename.d.ts +22 -0
- package/lib/src/utils/pageFeature.d.ts +27 -0
- package/lib/src/utils/pageFrontmatter.d.ts +21 -0
- package/lib/src/utils/pageNotes.d.ts +150 -0
- package/lib/src/utils/pageTitleRule.d.ts +37 -0
- package/lib/src/utils/pageToArticle.d.ts +59 -0
- package/lib/src/utils/pageUrl.d.ts +18 -0
- package/lib/src/utils/passwordChange.d.ts +12 -0
- package/lib/src/utils/passwordHash.d.ts +60 -0
- package/lib/src/utils/permissionCatalog.d.ts +52 -0
- package/lib/src/utils/pluginFormatters.d.ts +452 -0
- package/lib/src/utils/pluginFormatters.js +714 -0
- package/lib/src/utils/privateLinkRewrite.d.ts +42 -0
- package/lib/src/utils/privateStoreAccess.d.ts +57 -0
- package/lib/src/utils/privateStoreAccess.js +65 -0
- package/lib/src/utils/privateStoreCatalogs.d.ts +40 -0
- package/lib/src/utils/privateStoreCrypto.d.ts +127 -0
- package/lib/src/utils/privateStoreDoor.d.ts +181 -0
- package/lib/src/utils/privateStoreExport.d.ts +72 -0
- package/lib/src/utils/privateStoreFiles.d.ts +120 -0
- package/lib/src/utils/privateStoreMeta.d.ts +64 -0
- package/lib/src/utils/privateStoreMigrations.d.ts +37 -0
- package/lib/src/utils/privateStorePath.d.ts +259 -0
- package/lib/src/utils/privateStorePath.js +436 -0
- package/lib/src/utils/privateStoreTakeout.d.ts +76 -0
- package/lib/src/utils/privateStoreUnlock.d.ts +175 -0
- package/lib/src/utils/proxyClaim.d.ts +59 -0
- package/lib/src/utils/proxyClaim.js +30 -0
- package/lib/src/utils/redactPrivateNames.d.ts +21 -0
- package/lib/src/utils/redactPrivateNames.js +89 -0
- package/lib/src/utils/redactSecrets.d.ts +58 -0
- package/lib/src/utils/redactSecrets.js +171 -0
- package/lib/src/utils/renameLinkRewrite.d.ts +112 -0
- package/lib/src/utils/roleGrants.d.ts +35 -0
- package/lib/src/utils/safeRedirect.d.ts +32 -0
- package/lib/src/utils/schedule.d.ts +54 -0
- package/lib/src/utils/secretFileMode.d.ts +17 -0
- package/lib/src/utils/seededShippedPages.d.ts +45 -0
- package/lib/src/utils/sensitiveValues.d.ts +59 -0
- package/lib/src/utils/sensitiveValues.js +106 -0
- package/lib/src/utils/sessionEnd.d.ts +12 -0
- package/lib/src/utils/sessionGeneration.d.ts +24 -0
- package/lib/src/utils/sessionIdle.d.ts +41 -0
- package/lib/src/utils/sessionLimits.d.ts +68 -0
- package/lib/src/utils/shareLockbox.d.ts +64 -0
- package/lib/src/utils/sigstoreTrustedRoot.d.ts +33 -0
- package/lib/src/utils/sniffMime.d.ts +21 -0
- package/lib/src/utils/storeSearchIndex.d.ts +75 -0
- package/lib/src/utils/subjectMayDo.d.ts +21 -0
- package/lib/src/utils/systemCategoryRules.d.ts +30 -0
- package/lib/src/utils/systemCategoryRules.js +41 -0
- package/lib/src/utils/userCreateError.d.ts +62 -0
- package/lib/src/utils/username.d.ts +53 -0
- package/lib/src/utils/vaultUrlRewrite.d.ts +27 -0
- package/lib/src/utils/version.d.ts +84 -0
- package/lib/src/utils/videoFrame.d.ts +21 -0
- package/package.json +54 -3
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Policy Decision Point (#1431, step 6).
|
|
3
|
+
*
|
|
4
|
+
* One component answers "may this subject perform this action", and the
|
|
5
|
+
* delegation ceilings run here, once. Before this, the capability path ran the
|
|
6
|
+
* agent-token and share ceilings in `UserManager.hasPermission` and the page
|
|
7
|
+
* path ran its own copies in `PolicyInformationPoint` — the same protection implemented
|
|
8
|
+
* twice, with nothing keeping the two in step.
|
|
9
|
+
*
|
|
10
|
+
* __This step moves no behaviour.__ The ordering below is exactly what
|
|
11
|
+
* `UserManager.hasPermission` did, comments and all, so the decision is
|
|
12
|
+
* identical and only its address changes. The page path joins in step 7, which
|
|
13
|
+
* is where orderings actually have to be reconciled.
|
|
14
|
+
*
|
|
15
|
+
* The roles the PEP is playing, for anyone reading this later:
|
|
16
|
+
*
|
|
17
|
+
* - __PEP__ — routes, manager doors, the availability gate. They ask and
|
|
18
|
+
* enforce (401 vs 403); they never decide.
|
|
19
|
+
* - __PDP__ — this. Takes a subject and an action, returns permit or deny.
|
|
20
|
+
* - __PIP__ — `PolicyInformationPoint`: the subject's attributes and the
|
|
21
|
+
* page's own rules (#1431 step 13).
|
|
22
|
+
* - __PAP__ — `ConfigurationManager` and the admin screens, where policy is
|
|
23
|
+
* written.
|
|
24
|
+
*/
|
|
25
|
+
import BaseManager from '../managers/BaseManager.js';
|
|
26
|
+
import type { PermissionSubject, JobSubject } from '../managers/UserManager.js';
|
|
27
|
+
import type { WikiEngine } from '../types/WikiEngine.js';
|
|
28
|
+
import type { Decision, DecisionRequest, Policy } from '../types/Policy.js';
|
|
29
|
+
import { type RoleGrant } from '../utils/roleGrants.js';
|
|
30
|
+
export declare const POLICIES_KEY = "ngdpbase.access.policies";
|
|
31
|
+
export declare const POLICIES_ENABLED_KEY = "ngdpbase.access.policies.enabled";
|
|
32
|
+
export declare class PolicyDecisionPoint extends BaseManager {
|
|
33
|
+
/**
|
|
34
|
+
* A manager so every PEP can reach it through `engine.getManager`, the same
|
|
35
|
+
* way it reaches anything else. It holds no state of its own: a decision is
|
|
36
|
+
* derived, never stored.
|
|
37
|
+
*/
|
|
38
|
+
constructor(engine: WikiEngine);
|
|
39
|
+
/**
|
|
40
|
+
* The policies in force right now, highest priority first.
|
|
41
|
+
*
|
|
42
|
+
* - `ngdpbase.access.policies.enabled` false — its default when unset —
|
|
43
|
+
* means none;
|
|
44
|
+
* - an entry without a string `id` is not a policy, and is skipped;
|
|
45
|
+
* - two entries with the same `id` are both kept. Merging `id` arrays by id
|
|
46
|
+
* is the configuration merge's rule (between the layers), and within one
|
|
47
|
+
* layer a duplicate is an authoring error that `PolicyValidator` reports —
|
|
48
|
+
* not something to resolve silently here.
|
|
49
|
+
*/
|
|
50
|
+
policies(): Policy[];
|
|
51
|
+
/**
|
|
52
|
+
* What each role permits: role name → the actions its holders are granted.
|
|
53
|
+
*
|
|
54
|
+
* It mirrors the evaluator's ROLE matching — an allow policy naming a role
|
|
55
|
+
* grants its actions, a deny policy naming it takes them away, lower
|
|
56
|
+
* priority first so a higher-priority deny lands last and wins. It does not
|
|
57
|
+
* evaluate resource patterns or the ceilings, so it is a summary for a human
|
|
58
|
+
* reading a table (the admin Security Policy Summary, a profile), never an
|
|
59
|
+
* authorisation answer — that is {@link permits} with the caller's subject.
|
|
60
|
+
*
|
|
61
|
+
* Each role used to carry an inline `permissions[]` display copy kept
|
|
62
|
+
* matched by hand (#713); this derives the table from the policies instead.
|
|
63
|
+
*/
|
|
64
|
+
rolePermissions(): Map<string, Set<string>>;
|
|
65
|
+
/**
|
|
66
|
+
* What the given roles grant together, each with where it applies (#1539):
|
|
67
|
+
* an action is limited only when every role granting it is limited, and
|
|
68
|
+
* `where` collects the places those limited grants name — so `vault-owner`'s
|
|
69
|
+
* actions read "in your own vaults". A summary, never an answer.
|
|
70
|
+
*/
|
|
71
|
+
grantsForRoles(roles: readonly string[]): RoleGrant[];
|
|
72
|
+
/** {@link rolePermissions} as plain sorted arrays — for template data and JSON. */
|
|
73
|
+
rolePermissionLists(): Record<string, string[]>;
|
|
74
|
+
/**
|
|
75
|
+
* Everything the given roles permit together, sorted: the union of their
|
|
76
|
+
* rows in {@link rolePermissions}, so a user's own list is exactly what the
|
|
77
|
+
* admin summary shows for the roles they hold. A summary, never an answer.
|
|
78
|
+
*/
|
|
79
|
+
permissionsForRoles(roles: readonly string[]): string[];
|
|
80
|
+
/** Where a subject's attributes come from (#1431 step 13). */
|
|
81
|
+
private informationPoint;
|
|
82
|
+
/**
|
|
83
|
+
* Authorise a request: may THIS subject perform `action`? The boolean form
|
|
84
|
+
* of {@link decide} for a capability. It was `UserManager.hasPermission`
|
|
85
|
+
* until #1431 step 14; the decision was already here, only the door moved.
|
|
86
|
+
*
|
|
87
|
+
* Takes a `PermissionSubject` — the request's own identity, forwarded from
|
|
88
|
+
* `req.userContext` (WikiContext, ApiContext, ParseContext) or a
|
|
89
|
+
* `JobContext` for work with no request (#631). Roles arrive already
|
|
90
|
+
* resolved; the session middleware did that once per request.
|
|
91
|
+
*
|
|
92
|
+
* #1173 Part B: the username-string overload this method once accepted is
|
|
93
|
+
* gone. A string cannot carry `viaToken`, so the agent-token ceiling below
|
|
94
|
+
* had nothing to read and every string-form call resolved against the
|
|
95
|
+
* owner's full roles. There is one path now, and the type makes the other
|
|
96
|
+
* impossible. Callers with no subject to hand over have one of two
|
|
97
|
+
* legitimate shapes: `ANONYMOUS_SUBJECT`, or the
|
|
98
|
+
* separate question {@link userHoldsPermission} — "does the named user hold
|
|
99
|
+
* this?" — which is a lookup about somebody else, not an authorisation.
|
|
100
|
+
*
|
|
101
|
+
* @param subject - The identity being authorised, with `roles` resolved and
|
|
102
|
+
* `viaToken` present when a bearer token authenticated it.
|
|
103
|
+
* @param action - Action/permission to check (e.g., 'page-create', 'user-read')
|
|
104
|
+
* @returns True if the subject may perform the action under current policy
|
|
105
|
+
*/
|
|
106
|
+
permits(subject: PermissionSubject | JobSubject | null | undefined, action: string): Promise<boolean>;
|
|
107
|
+
/**
|
|
108
|
+
* Does the subject HOLD this permission (#1635)? Policy alone — the
|
|
109
|
+
* step-up freshness rule is not applied. A different question from
|
|
110
|
+
* {@link permits}, which is "may it act now", and named so: an affordance
|
|
111
|
+
* (show the reveal button, show the sign-in methods section) asks this, so a
|
|
112
|
+
* person whose sign-in is not fresh still sees the way to the prompt that
|
|
113
|
+
* makes it fresh. A door never asks this.
|
|
114
|
+
*/
|
|
115
|
+
holds(subject: PermissionSubject | JobSubject | null | undefined, action: string): Promise<boolean>;
|
|
116
|
+
/**
|
|
117
|
+
* Step-up (#1525, #1635), decided here — in the one place every door asks —
|
|
118
|
+
* rather than by routes in front of the doors. A permission marked
|
|
119
|
+
* `step-up: true` needs a factor satisfied within
|
|
120
|
+
* `ngdpbase.auth.step-up.max-age-minutes` that reaches the level the
|
|
121
|
+
* subject's roles require. A request subject carries its `signIn`; a
|
|
122
|
+
* delegated credential (agent token, share) never satisfies it. Work with no
|
|
123
|
+
* request (a JobSubject: timers, operator commands) has no sign-in to be
|
|
124
|
+
* fresh and is not asked.
|
|
125
|
+
*
|
|
126
|
+
* A proxy (`viaProxy`, #1762) is NOT delegated here: a person is at the
|
|
127
|
+
* keyboard, and their own fresh sign-in counts (operator, 2026-10-12). The
|
|
128
|
+
* subject's `signIn` and `aalCap` are the actor's — the session's — so the
|
|
129
|
+
* actor's sign-in must reach the level the represented person's roles
|
|
130
|
+
* require, capped at what the actor's account can reach.
|
|
131
|
+
*/
|
|
132
|
+
private stepUpRefuses;
|
|
133
|
+
/** Does the named issuer of a vault link still hold `action` inside that vault (#1539)? The vault rule, resolved live. */
|
|
134
|
+
private issuerHoldsInVault;
|
|
135
|
+
/**
|
|
136
|
+
* Does this NAMED USER hold a permission? (#1173)
|
|
137
|
+
*
|
|
138
|
+
* A different question from {@link permits}, and that is why it has a
|
|
139
|
+
* different name. This one __inspects a user__ — "does bob hold
|
|
140
|
+
* `admin-system`?" — where there is no request, no token, and nothing to cap.
|
|
141
|
+
* `permits` __authorises a request__, so it must be handed the subject the
|
|
142
|
+
* request carries or an agent token's scope ceiling has nothing to read.
|
|
143
|
+
*
|
|
144
|
+
* They shared a name and one of them took a bare string, which is how #1164
|
|
145
|
+
* happened seventeen times. Splitting them means the dangerous question
|
|
146
|
+
* cannot be asked by accident. The subject is the PIP's, resolved live.
|
|
147
|
+
*/
|
|
148
|
+
userHoldsPermission(username: string, action: string): Promise<boolean>;
|
|
149
|
+
/**
|
|
150
|
+
* The permissions a user's roles give them, for display (#1431 step 10).
|
|
151
|
+
*
|
|
152
|
+
* The union of their roles' rows in the admin Security Policy Summary, read
|
|
153
|
+
* live from the policies — so the profile page and the admin page can never
|
|
154
|
+
* disagree. A summary for a human, not an authorisation answer: that is
|
|
155
|
+
* always {@link permits} with the subject.
|
|
156
|
+
*/
|
|
157
|
+
getUserPermissions(username: string): Promise<string[]>;
|
|
158
|
+
/** {@link getUserPermissions} with where each applies (#1539) — for the profile. */
|
|
159
|
+
getUserGrants(username: string): Promise<RoleGrant[]>;
|
|
160
|
+
/** The roles a user's summary is drawn from: theirs, live, or anonymous's. */
|
|
161
|
+
private rolesForSummary;
|
|
162
|
+
/**
|
|
163
|
+
* Decide. The order is load-bearing:
|
|
164
|
+
*
|
|
165
|
+
* 1. __The agent-token ceiling__, before anything else. A delegated token may
|
|
166
|
+
* only ever exercise a subset of its owner's rights, so a scope it does
|
|
167
|
+
* not carry is refused whatever policy says (#946).
|
|
168
|
+
* 2. __A share IS the policy__ for a capability check (#1222). The subject is
|
|
169
|
+
* anonymous; what it may do is what the issuer delegated, bounded by what
|
|
170
|
+
* the issuer holds NOW — so this returns rather than falling through to
|
|
171
|
+
* the evaluator, and a share works on an instance whose policy grants
|
|
172
|
+
* anonymous nothing.
|
|
173
|
+
* 3. __Roles resolved live__ when the subject asks for it (`resolveRolesNow`),
|
|
174
|
+
* so a job authorises against the roles its principal holds at decision
|
|
175
|
+
* time, not at enqueue time (#631, #1212).
|
|
176
|
+
* 4. __The policies__, through `PolicyEvaluator`.
|
|
177
|
+
*/
|
|
178
|
+
/**
|
|
179
|
+
* The delegation ceilings alone: does the token's scope, the share's grant,
|
|
180
|
+
* or the proxy grant (#1762, {@link proxyCeiling}) permit this at all?
|
|
181
|
+
*
|
|
182
|
+
* Returns `null` when the caller carries no delegation — there is nothing to
|
|
183
|
+
* bound, and the answer is whatever policy says.
|
|
184
|
+
*
|
|
185
|
+
* The refusal reasons are the vocabulary already recorded by
|
|
186
|
+
* `PolicyInformationPoint.logAccessDecision` — `token_scope_deny`, `share_action_deny`,
|
|
187
|
+
* `share_expired`, `share_resource_deny`, `share_issuer_deny`, and for a
|
|
188
|
+
* proxy `proxy_combined_deny`, `proxy_kind_deny`, `proxy_revoked`,
|
|
189
|
+
* `proxy_scope_deny`, `proxy_actor_deny` — because they
|
|
190
|
+
* land in the audit trail, and renaming one silently changes what an
|
|
191
|
+
* assessor reads.
|
|
192
|
+
*
|
|
193
|
+
* Separate from {@link decide} because a caller sometimes needs ONLY this.
|
|
194
|
+
* `filterAccessiblePages` bounds the subject once and then applies each
|
|
195
|
+
* page's own rules; running a full decision there would refuse the whole
|
|
196
|
+
* list on a global policy that the page's frontmatter or ACL markup would
|
|
197
|
+
* have overridden.
|
|
198
|
+
*/
|
|
199
|
+
ceiling(subject: PermissionSubject | JobSubject | null | undefined, request: DecisionRequest): Promise<Decision | null>;
|
|
200
|
+
/**
|
|
201
|
+
* The proxy ceiling (#1762 slice 2): someone acting for the subject's person
|
|
202
|
+
* under a proxy grant. Refused unless ALL hold, in this order:
|
|
203
|
+
*
|
|
204
|
+
* - the subject carries no token or share as well (`proxy_combined_deny`),
|
|
205
|
+
* and the claim is a proxy — `impersonation` (#1763) admits nothing yet
|
|
206
|
+
* (`proxy_kind_deny`);
|
|
207
|
+
* - the grant is still in force, re-read live on every decision: not
|
|
208
|
+
* revoked, not past its end date, proxy access still on, and naming this
|
|
209
|
+
* person and this actor, with every permission the subject was built with,
|
|
210
|
+
* and the person represented still an active account (`proxy_revoked`);
|
|
211
|
+
* - the action is one the grant carries — the claim's scopes, each still in
|
|
212
|
+
* the live grant (`proxy_scope_deny`);
|
|
213
|
+
* - the actor holds the action themselves, live — an inactive actor holds
|
|
214
|
+
* nothing (`proxy_actor_deny`).
|
|
215
|
+
*
|
|
216
|
+
* Passing is not an allow: policy then runs against the represented person
|
|
217
|
+
* (`decide` falls through, as for a token), so the result is grant ∩
|
|
218
|
+
* represented ∩ actor. The actor is asked whether they HOLD the action —
|
|
219
|
+
* policy alone — because step-up is asked of this subject, with the actor's
|
|
220
|
+
* own sign-in, once policy has said yes.
|
|
221
|
+
*/
|
|
222
|
+
private proxyCeiling;
|
|
223
|
+
/** Does the named actor HOLD `action` (policy alone, live)? Step-up is the proxy subject's question, not theirs. */
|
|
224
|
+
private actorHolds;
|
|
225
|
+
/**
|
|
226
|
+
* Decide. The order is load-bearing:
|
|
227
|
+
*
|
|
228
|
+
* 1. __The ceilings__ (see {@link ceiling}), before anything else. A
|
|
229
|
+
* delegated credential may only ever exercise a subset of what was
|
|
230
|
+
* delegated, whatever policy says (#946, #1222); a proxy only what its
|
|
231
|
+
* grant carries and its actor holds, and then policy for the person
|
|
232
|
+
* represented (#1762).
|
|
233
|
+
* 2. __A share IS the policy__ for a capability check, so a passing share
|
|
234
|
+
* returns an allow rather than falling through to the evaluator — a share
|
|
235
|
+
* must work on an instance whose policy grants anonymous nothing.
|
|
236
|
+
* 3. __Roles resolved live__ when the subject asks for it (`resolveRolesNow`),
|
|
237
|
+
* so a job authorises against the roles its principal holds at decision
|
|
238
|
+
* time, not at enqueue time (#631, #1212).
|
|
239
|
+
* 4. __The policies__, through `PolicyEvaluator`.
|
|
240
|
+
*/
|
|
241
|
+
decide(subject: PermissionSubject | JobSubject | null | undefined, request: DecisionRequest): Promise<Decision>;
|
|
242
|
+
/** `decide`, with the step-up rule applied or not — {@link holds} is the only caller that leaves it out. */
|
|
243
|
+
private evaluate;
|
|
244
|
+
}
|
|
245
|
+
export default PolicyDecisionPoint;
|