凭据与 keystore
本页由仓库原文构建生成。技术正文保留原文;版本要求、授权与限制以正文为准。
Read this when status reports CONFIG_MISSING, when setting up a profile’s
password, or when a user reports credential/keystore problems. See
profiles.md for multi-environment (profile) management.
First-time setup
Section titled “First-time setup”Run status first; on CONFIG_MISSING, collect all credentials in a SINGLE
question call (one array, not field-by-field — sequential calls open separate
UI tabs that can overwrite earlier answers). Fields:
- SAP System URL — include port, e.g.
https://my-sap.example.com:8000 - SAP Username — dialog user, e.g.
DEVELOPER - SAP Password — SAP logon password
- SAP Client — 3 digits, e.g.
100 - Skip SSL check? — yes for self-signed/internal, no for production
Save non-secret fields with one command, then store the password:
sap-adt configure --profile dev \ --url "https://my-sap-dev.example.com:8000" \ --username "DEVELOPER" --client "100"# add --no-verify-ssl when skipping the certificate checksap-adt credentials set dev # hidden promptNon-interactive alternative (avoids shell history; configure moves the value into the keystore and removes it from config.json):
SAP_PASSWORD="mysecret" sap-adt configure --profile dev \ --url "https://my-sap-dev.example.com:8000" \ --username "DEVELOPER" --client "100"Verify with status. Flagged configure failures are JSON error envelopes
(CONFIG_MISSING for missing fields, exit 2; BAD_REQUEST for an invalid
profile name, exit 1).
Where secrets live
Section titled “Where secrets live”- Connection profile (non-secret):
~/.sap-adt-cli/config.json(mode 0600). - Password: the operating-system keystore only, never plain config text.
Old single-connection / plaintext configs migrate automatically to a
profile named
defaultwith the password moved into the keystore. - Backend priority:
env(SAP_ADT_<PROFILE>_PASSWORD) →keyring(Credential Manager / Keychain / Secret Service) →dpapi(WSL2) →pass(GPG) →file(scrypt + Fernet fallback with a master passphrase). - Stored passwords are not machine-portable (DPAPI / Keychain binding);
re-run
credentials set <profile>after moving machines. - There is no export command;
-v/--verboseoutput and tracebacks stay redacted. Global--keystore <name>forces a backend fail-closed.
Credential commands
Section titled “Credential commands”| Command | Purpose |
|---|---|
credentials status |
Stored/not-stored per profile; never prints the secret |
credentials doctor |
Active backend, file modes, entries — run first on credential issues |
credentials set PROFILE [--user U] [--password P] |
Store a password (hidden prompt preferred) |
credentials forget PROFILE |
Purge the password from all writable keystores |
Environment / .env overrides
Section titled “Environment / .env overrides”- Explicit dotenv file: fill
SAP_URL,SAP_USERNAME,SAP_PASSWORD,SAP_CLIENT(template insetup.md, saved to a private path), then declare it withSAP_ADT_DOTENV=/path/to/.env. The CLI never scans the current directory or the skill folder; unsetSAP_ADT_DOTENVto use profiles only. - One-off env vars (nothing written):
SAP_URL=… SAP_USERNAME=… SAP_PASSWORD=… SAP_CLIENT=100 sap-adt status. - Precedence: process env vars → dotenv (SAP_ADT_DOTENV) → selected profile.
When all four
SAP_*are present they override profiles entirely;SAP_PROFILEonly selects among profiles otherwise. - Optional:
SAP_LANGUAGE,SAP_VERIFY_SSL=0,SAP_ALLOW_WRITE=1,SAP_ALLOW_TRANSPORT=1,SAP_ALLOW_DEBUG=1(CLI 1.6.1+). Keep capability flags0unless the user explicitly authorizes that capability. Debug controls also require explicitSAP_ENVIRONMENT=dev|qas.
Capability flags
Section titled “Capability flags”--allow-write controls write-source/activate; --allow-transport
controls create-transport/release-transport. Both default to disabled;
prefer profile scope, with legacy global fallbacks only when the corresponding
profile flag is absent. --allow-debug independently enables debugger
setup/controls on one non-production profile and defaults to disabled.
It never inherits source/transport permissions or a global flag; those
permissions can remain false. Verify the active profile with status.
Enabling a flag never bypasses per-operation [y/N] confirmation.
Debug execution may change business data even though the CLI does not edit
source or variables. Existing session reads and cleanup do not need source
write permission or re-enabling debug permission.