CAP for nodejs安全的暴露接口练习
Starting from the risk-management sample, the walkthrough adds an open ExternalAPI service beside the existing RiskService, then moves every security annotation into a separate service-auth.cds file: @requires: authenticated-user on one entity, role-scoped @restrict grants for RiskViewer and RiskManager on another. It tests the unprotected action locally with cds watch, calling it from Postman with the session cookie read out of SAP Business Application StudioSAP Business Application StudioSAP's development environment for business applications, delivered as a cloud service and opened in a browser, where work happens in preconfigured dev spaces.sap official, btp's preview tab. It then deploys to BTP and reads Risks with a client-credentials OAuth token fetched from a service key of the cpapp-auth instance, after changing that entity's READ grant from RiskViewer to authenticated-user, which the post, citing capire's CDS-based Authorization page, describes as a grant for a technical user integrating systems rather than for access from a front end.
Where it sits
Who is behind it
Before you read it
ApplicabilityCore changedAuthorization has changed twice since this was published, most recently in CAP Java 3.7.1, 2025-01-30.
This is a derived prompt to re-check the work, not a claim that the work is wrong. Exact stale statements are recorded separately after editorial review.
Properties
About this work
For authorization
For authentication
For local-development
Details
Graph
Source
History
- Entered the atlasDiscovered via SAP Community · cap-tag.
For your agent
- Ref
content:cap-for-nodejs- JSON
- /content/cap-for-nodejs.json
- MCP
- Connecting an agent