executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
sap-btp-credential-storeSAP BTP Credential Store — secure credential vault on BTP, credential retrieval API, service binding secrets, encrypted password storage, credential rotation, integration with CAP and Cloud Foundry apps. Use when securely storing credentials on BTP, managing service credentials, or implementing credential rotation.
Independent GitHub snapshot · Automated classification · Original documentation governs
name: sap-btp-credential-store description: SAP BTP Credential Store — secure credential vault on BTP, credential retrieval API, service binding secrets, encrypted password storage, credential rotation, integration with CAP and Cloud Foundry apps. Use when securely storing credentials on BTP, managing service credentials, or implementing credential rotation. trigger:
Secure vault for credentials and secrets on SAP BTP — encrypted storage with access control and audit logging.
cf login)@sap/cds ≥ 7.x and @sap/credential-store package# Create service instance
cf create-service credential-store standard my-credstore
# Bind to your application
cf bind-service my-app my-credstore
# Create a service key for admin API access
cf create-service-key my-credstore admin-key
# Retrieve credentials for API calls
cf service-key my-credstore admin-key
# Store a password credential
curl -X POST "https://credstore.cfapps.<region>.hana.ondemand.com/api/v1/credentials/password" \
-H "Authorization: Bearer $CREDSTORE_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "PAYMENT_GATEWAY",
"value": "super_secret_password",
"username": "payment_user"
}'
# Read credential back
curl "https://credstore.cfapps.<region>.hana.ondemand.com/api/v1/credentials/password/PAYMENT_GATEWAY" \
-H "Authorization: Bearer $CREDSTORE_TOKEN"
# Install the SDK
npm install @sap/credential-store
const cds = require('@sap/cds')
const { CredentialStore } = require('@sap/credential-store')
module.exports = class PaymentService extends cds.ApplicationService {
async init() {
this.on('processPayment', async (req) => {
const credStore = new CredentialStore()
const { username, password } = await credStore.readPassword('PAYMENT_GATEWAY')
const result = await axios.post('https://payment.vendor.com/api/charge', {
amount: req.data.amount,
customerId: req.data.customerId
}, { auth: { username, password } })
return result.data
})
await super.init()
}
}
const { CredentialStore } = require('@sap/credential-store')
const credStore = new CredentialStore()
async function rotateCredentials() {
const current = await credStore.readPassword('DB_ADMIN')
const newPassword = generateSecurePassword()
// Step 1: Update database with new password
await updateDatabasePassword(current.username, current.password, newPassword)
// Step 2: Store new password in Credential Store
await credStore.writePassword('DB_ADMIN', {
username: current.username,
password: newPassword
})
console.log('Credential rotated:', new Date().toISOString())
}
Schedule rotation via SAP BTP Job Scheduling service (every 30 days recommended).
Pitfall: Credentials hardcoded in source code
default-env.json or source files.Pitfall: Rotation breaks the running app
Pitfall: Credential read latency on cold start
Pitfall: Service key token expired
VCAP_SERVICES in the app. For CLI scripts, fetch a fresh token before each batch.Pitfall: Exceeded credential limit
# 1. Verify service instance and binding
cf services | grep my-credstore
cf env my-app | grep -A5 credential-store
# 2. Test credential read via API
curl "https://credstore.cfapps.<region>.hana.ondemand.com/api/v1/credentials/password/PAYMENT_GATEWAY" \
-H "Authorization: Bearer $CREDSTORE_TOKEN"
# → Should return JSON with username + masked password
# 3. Test from CAP app
curl -X POST https://my-app.cfapps.<region>.hana.ondemand.com/odata/v4/Payments/processPayment \
-H "Content-Type: application/json" \
-d '{"amount":100,"customerId":"C001"}'
# → Should succeed without credential errors
# 4. Verify rotation job ran
# Check Job Scheduling service logs or run: rotateCredentials() manually and confirm no auth errors