@sap/ams-dev
Compiles the DCL authorization policies of SAP's Authorization Management Service to DCN, so an AMS-secured application runs and is tested on a laptop.
Policies for AMS are written in DCL and the runtime reads DCN, so nothing local can evaluate one until it is compiled. This is the compiler: a compile-dcl bin takes a DCL source root and a DCN output root, runs entirely in Node.js through WebAssembly with no Java installed, and can be told to fail on a warning or a deprecation rather than only on an error. In a CAP project it reacts to DCL changes, compiling them under mocked authentication and, under ias authentication, pushing the policies to the AMS server from the SAP Identity service binding. A test then runs against the local bundle with policy assignments mocked per tenant and user in JSON, which is what its own pretest and posttest example wires up.
Facts
Where it sits
Who is behind it
In the atlas: maintains 137, wrote 14@SAPmaintainer
Before choosing this
Conditions
LicenceSAP Developer License Agreement 3.2 CAP§ 1, 2, 3A cds-plugin is used with SAP CAP materials, or an artifact is explicitly identified as a CAP plugin or application.
- § 1 License. Productive customer applications are limited to SAP BTP or another SAP-licensed platform, and mass extraction to a non-SAP product is restricted except where solely required for SAP interoperability.
- § 2 Intellectual Property. The agreement retains SAP's rights in the covered materials and limits making APIs, tools or software available to third parties, while preserving ownership of customer applications subject to SAP's underlying rights.
- § 3 Artificial Intelligence Training. The agreement prohibits use of the covered materials and customer applications for training artificial-intelligence models or systems.
PracticalFunctional boundary
Its own account of itself is local running and tests: the DCN it writes serves as input for running an application using AMS on the DCL bundle locally. It carries the SAP Developer License Agreement rather than an open-source licence, and the repository named in its package metadata is an internal SAP host, so the npm page is the only thing to read.
What it declares
Every artifact
- Type
- Build tool
- Origin
- By SAP
- Runtime
- Node.js
As a build tool
- Declared for
- >=8
- Distributed through
- npm
Connections
Deciding who may read or change what, down to instance level
Running the whole stack on a laptop against real bindings
Download
Install
npm add @sap/ams-devDerived from the package name. No recipe recorded; the README has the configuration.
README
quoted from @sap/ams-dev@3.0.2 under SAP DEVELOPER LICENSE AGREEMENT, read@sap/ams-dev
This module provides tooling support for extending applications which authenticate users via the SAP Cloud Identity Services with AMS (Authorization Management Service) authorization checks.
The primary functionality provided by this module is enabling tests on local DCL (Data Control Language) bundles. To this end, it provides the compile-dcl script to produce DCN (Data Control Notation) files for the ADC (Authorization Decision Controller) used in @sap/ams versions >= 1.17.0.
CAP integration
For CAP (Cloud Application Programming Model) applications, the plugin integrates nicely into mocked auth and hybrid environments which allows developing local applications with AMS bound to SAP Identity service instances on SAP BTP. In both cases, it reacts to changes of DCL files. During mocked auth, it compiles them to DCN files. When using ias auth, it provides a feature to push the policies to the AMS server from the SAP Identity service binding.
For details, refer to the documentation of @sap/ams.
DCL compilation
This module provides a bin script called compile-dcl which compiles .dcl files to .dcn files which serve as input for running an application using AMS on the DCL bundle locally, e.g. for unit tests.
Note: The DCL compiler now runs entirely in Node.js using WebAssembly. Java is no longer required.
If you install this module globally via npm, you can call the compile-dcl CLI script from any shell. If you install it locally in a project, you can run it via npx compile-dcl (or npx --package=@sap/ams-dev compile-dcl to make 100% sure you are running the compile-dcl script from this module).
compile-dcl
The script requires both a source and an output directory as parameter in addition to some optional parameters (see compile-dcl --help):
Usage: compile-dcl --dcl [DCL_SRC_ROOT_DIR] --output [DCN_OUTPUT_ROOT_DIR]
Options:
--help Show help [boolean]
--version Show version number [boolean]
-d, --dcl path to DCL root directory [string] [required]
-o, --output path to DCN output root directory [string] [required]
-l, --log-level log level
[string] [choices: "info", "error", "silent"] [default: "error"]
-f, --failOn fail on error, deprecation or warning
[string] [choices: "error", "deprecation", "warning"] [default: "error"]
Examples:
compile-dcl -d src/dcl -o build/dcn compiles DCL in root directory src/dcl to
DCN in output root directory build/dcn
We recommend the use of --failOn warning to not miss out on potential future deprecation warnings regarding the DCL syntax.
Testing with a local DCL bundle
To test your application with local DCL policy files and mocked policy assignments, follow these steps depending on the @sap/ams version of your project.
@sap/ams 3.x
- Compile the DCL bundle to DCN before running the application
- Use
AuthorizationManagementService#fromLocalDcn(dcnRoot, config)to create theAuthorizationManagementServicesingleton with the followingconfig:
dcnRoot(string) the root directory of the DCN compilation.config.assignments(string | PolicyAssignments, optional) a path to aPolicyAssignmentsJSON file or an in-memoryPolicyAssignmentsobject.
In PolicyAssignments, the assignments are based on the SAP Identity Service app_tid (tenant) and scim_id from the user's (mocked) token.
{
"tenant1": {
"user1": [
"sales.readAllSalesOrders"
],
"user2": [
"sales.readAllSalesOrders",
"sales.writeAllSalesOrders"
]
},
"tenant2": {
"user1": [
"sales.readAllSalesOrders",
"sales.writeAllSalesOrders"
]
}
}
In your package.json, you could set-up the pretest and posttest lifecycle scripts to perform the necessary DCL compilation before the tests and cleanup the DCN output afterwards.
This is an example package.json for an application using jest as test framework but any other framework can be used:
"config": {
"dcn_root": "test/dcn"
},
"scripts": {
"pretest": "npx --package=@sap/ams-dev compile-dcl -d test/dcl -o $npm_package_config_dcn_root",
"jest": "AMS_DCN_ROOT=$npm_package_config_dcn_root jest", // or any other framework
"test": "npm run jest",
"posttest": "rm -rf $npm_package_config_dcn_root"
}
@sap/ams 2.x
- Compile the DCL bundle to DCN before running the application
- Set environment variable
AMS_DCN_ROOTto the DCN output root folder - Create a
data.jsonfile in which you assign policies to mock users - Run the application
- In @sap/ams versions >= 1.17, when creating a
PolicyDecisionPointwithout the new constructor argument for passing an explicit bundle loader, it will automatically load the bundle located atAMS_DCN_ROOTwhen its value has been set
Inside the data.json file you can mock policy assignments to users based on the SAP Identity Service app_tid (tenant) and scim_id from the user's (mocked) token.
{
"principal2policies": {
"tenant1": {
"user1": [
"sales.readAllSalesOrders"
],
"user2": [
"sales.readAllSalesOrders",
"sales.writeAllSalesOrders"
]
},
"tenant2": {
"user1": [
"sales.readAllSalesOrders",
"sales.writeAllSalesOrders"
]
}
}
}
In your package.json, you could set-up the pretest and posttest lifecycle scripts to perform the necessary DCL compilation before the tests and cleanup the DCN output afterwards.
If you use a data.json for mock policy assignments, copy it to the DCN root folder after compilation.
Make sure to run the tests with the correct AMS_DCN_ROOT.
This is an example package.json for an application using jest as test framework but any other framework can be used:
"config": {
"dcn_root": "test/dcn"
},
"scripts": {
"compile-dcl": "npx --package=@sap/ams-dev compile-dcl -d test/dcl -o $npm_package_config_dcn_root && cp test/dcl/data.json $npm_package_config_dcn_root/data.json",
"pretest": "npm run compile-dcl",
"jest": "AMS_DCN_ROOT=$npm_package_config_dcn_root jest", // or any other framework
"test": "npm run jest",
"posttest": "rm -rf $npm_package_config_dcn_root"
}History
Others providing
- abap2UI5 Playgroundabap2UI5 PlaygroundABAP in the editor on the left and the abap2UI5 app it builds on the right, both inside one browser tab: the framework is transpiled to JavaScript at build time and the class in the editor is compiled when Run is pressed.community org, abapIn-browser ABAP editor beside the abap2UI5 app it buildsfrom ABAP
- web-abap2UI5web-abap2UI5A build pipeline and the page it deploys: the abap2UI5 backend downported, transpiled to JavaScript and webpacked into one script that runs inside a browser tab, with no server and no SAP system behind it.community org, abapabap2UI5 transpiled to JavaScript and run in a browser tabfrom ABAP
- vite-plugin-cdsvite-plugin-cdsA CAP plugin that serves a Vite app from the app folder through cds watch, makes .cds files importable into the frontend build, and can polyfill enough of Node to run @sap/cds in the browser.independent, capServes a Vite app through cds watch and imports .cds filesfrom CAP
- com.sap.cds:cds-feature-dev-dashboardcom.sap.cds:cds-feature-dev-dashboardA browser dashboard for a running CAP Java service that shows and manages its messaging, resilience and multitenancy state while developing, open to users with the cds.Developer role.sap official, capBrowser dashboard for a running CAP Java service during developmentfrom CAP
- com.sap.cds:cds-maven-plugincom.sap.cds:cds-maven-pluginThe Maven plugin that runs CDS build steps in a CAP Java project: compiling the model, generating typed Java accessor interfaces and adding facets to an existing project.sap official, capMaven plugin running CDS build steps in a CAP Java projectfrom CAP
- @cap-js-community/common@cap-js-community/commonSix independent features for CAP services in one package: replication cache, migration check, rate limiting, a Redis client broker, a local HTML5 repository and a CDM builder.community org, capSix CAP features in one package, from replication cache to rate limitsfrom CAP
- abap_trial_dockerabap_trial_dockerShell scripts that build a Docker image from the SAP NetWeaver ABAP Developer Edition 7.52 SP04 installation files and run it as an unprivileged container, setting the stable hostname the installer wants.independent, abapScripts running the ABAP Developer Edition in Dockerfrom ABAP
- @neoimpulse/cap-js-bootstrap@neoimpulse/cap-js-bootstrapA command-line tool that starts a local CAP environment with several services and an AppRouter together from one command, documented in German and requiring Node 22 or newer.independent, capCLI starting several CAP services and an AppRouter locally togetherfrom CAP
- open-steamgateopen-steamgateAn ABAP application server you clone and run on your own machine: transpiled ABAP serving classic /IWBEP/ OData v2 to Fiori over a local database, with no SAP system attached.independent, abapLocal ABAP server serving /IWBEP/ OData v2 without an SAP systemfrom ABAP
- pokrakam/abapDevSysInitpokrakam/abapDevSysInitA single ABAP report that automates setting up a new ABAP Developer Edition or trial system, from the user profile and a GitHub RFC destination to fetching abapGit and pulling repositories.independent, abapABAP report setting up a new ABAP Developer Edition or trial systemfrom ABAP
- @sang2x/captools@sang2x/captoolsA CLI of eight CAP development commands aimed at Cloud Foundry workflows, shipped without a repository or README, whose binding step writes resolved VCAP_SERVICES into default-env.json.independent, capCLI of CAP development tools for Cloud Foundry workflowsfrom CAP
- @sap/cds-dk@sap/cds-dkThe command line client and development toolkit for CAP projects, with the commands cds build, cds deploy, cds watch and cds add among them.sap official, capCommand line client and development toolkit for CAPfrom CAP
- @sap/cds@sap/cdsThe CAP Node.js runtime, which compiles the CDS model, serves the services declared in it, answers generic requests before any handler runs, and loads every cds-plugin.sap official, capCAP Node.js runtimefrom CAP
- dev-approuterdev-approuterA development-time wrapper for the SAP Application Router that serves UI5 and CDS modules once they are added to the project as dependencies.community org, capDev-time wrapper for the SAP Application Routerfrom CAP
- SAP Authorization and Trust Management serviceSAP Authorization and Trust Management serviceThe OAuth server behind a BTP application: issues the JWT the app checks, holds the scopes and role collections it checks against, and brokers trust to an identity provider. Bound, never installed.sap official, btpOAuth server issuing JWTs and holding scopes for BTP appsfrom BTP/BAIP
- OAuth 2.0 on SAP BTPOAuth 2.0 on SAP BTPOAuth 2.0 protection for applications and APIs on SAP BTP, listed in Neo regions: the authorization code grant for web applications and the client credentials grant for API and IoT scenarios.sap official, btpOAuth 2.0 grant flows for applications and APIs in Neo regionsfrom BTP/BAIP
- com.sap.cds:cds-services-bomcom.sap.cds:cds-services-bomThe Maven bill of materials for CAP Java, pinning every com.sap.cds module in a release, from the API and core runtime to the Spring Boot starters and the CQN engine, to the same version.sap official, capMaven bill of materials pinning CAP Java module versionsfrom CAP
- cap-toolkitcap-toolkitA utility bundle for CAP handlers, with a chainable HandlerBuilder, role checks, validation rules and query helpers, collecting boilerplate that otherwise repeats across projects into one dependency.independent, capUtility bundle for CAP handlers: builder, roles, validation, queriesfrom CAP
- @sap/ams@sap/amsDecides what a signed-in user may do in a Node.js application that authenticates through SAP Cloud Identity Services, from policies written in DCL.sap official, capAuthorization from DCL policies for Node.js apps on SAP Cloud Identityfrom CAP
- @sap/cds@sap/cdsThe CAP Node.js runtime, which compiles the CDS model, serves the services declared in it, answers generic requests before any handler runs, and loads every cds-plugin.sap official, capCAP Node.js runtimefrom CAP
- sap-usi-authority-checksap-usi-authority-checkA helper class, /USI/CL_AUTH, that checks whether the current user is authorized for the running transaction, mandatory for SchwarzIT's USI reports under their internal development guidelines.independent, abapAuthority check helper class used across SchwarzIT's USI reportsfrom ABAP
- cds-entra-idcds-entra-idA CAP plugin that maps Microsoft Entra ID groups and app roles onto cds.User roles, so @requires and @restrict keep working for a CAP app hosted on Azure App Services.independent, capMaps Microsoft Entra ID groups and app roles onto cds.User rolesfrom CAP
Details
Sources
Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.
Compatibility and provenance
History in the atlas
- First seen.
For your agent
- Ref
artifact:sap-ams-dev- JSON
- /artifacts/sap-ams-dev.json
- MCP
- Connecting an agent