webapps-secrets
语法
说明
webapps-secrets remove
从保管库中删除机密 keyName
keyValue
[--scope scopeValue
]keyName
。
webapps-secrets set-attributes --secret-key
设置机密 keyName
[attrName
attrValue
] [--scope scopeValue
] [--mode Add|Merge|Replace]keyName
的属性。您可以选择配置是否向键添加新属性、合并新属性和现有属性,或者用新属性替换所有现有属性。
webapps-secrets get-attributes --secret-key
返回名为 keyName
[--scope scopeValue
]keyName
的机密的属性。
webapps-secrets list [--scope
列出了 scopeValue
]scopeValue
范围内所有当前配置的机密。
webapps-secrets listAll
列出所有范围内当前配置的所有机密。
webapps-secrets --help
显示命令的帮助文本。
webapps-secrets --version
显示命令的版本信息。
示例
设置特定机密的值
要设置特定机密的值,请在系统命令行中输入:
webapps-secrets set mypassword hunter2
Vault location:C:\ProgramData\MathWorks\webapps\R2024b\config\webapps_private\webapps_secrets.xml
MATLAB Web App Server secrets configuration has been updated.
验证机密是否已添加。
webapps-secrets listAll
Vault location:C:\ProgramData\MathWorks\webapps\R2024b\config\webapps_private\webapps_secrets.xml
List of secret keys configured:
scope:<default>, secret key:mypassword
从服务器移除机密
要从服务器中删除现有的机密 mypassword
,请在系统命令行中输入:
webapps-secrets remove mypassword
Vault location:C:\ProgramData\MathWorks\webapps\R2024b\config\webapps_private\webapps_secrets.xml
MATLAB Web App Server secrets configuration has been updated.
设置机密的属性
属性是未加密的元数据,与机密和加密值一起存储在 webapps_secrets
XML 文件中。
要设置机密 myusername
的值,请在系统命令行中输入:
webapps-secrets set myusername mluser
Vault location:C:\ProgramData\MathWorks\webapps\R2024b\config\webapps_private\webapps_secrets.xml
MATLAB Web App Server secrets configuration has been updated.
要设置机密 myusername
的属性,请在系统命令行中输入:
webapps-secrets set-attributes --secret-key myusername hostname myhost port 8080
Vault location:C:\ProgramData\MathWorks\webapps\R2024b\config\webapps_private\webapps_secrets.xml
MATLAB Web App Server secrets configuration has been updated.
您可以使用 --mode
运算符修改机密的现有属性。
webapps-secrets set-attributes --secret-key myusername port 422 --mode Merge
Vault location:C:\ProgramData\MathWorks\webapps\R2024b\config\webapps_private\webapps_secrets.xml
MATLAB Web App Server secrets configuration has been updated.
获取机密的属性
要检索机密 myusername
的属性,请在系统命令行中输入:
webapps-secrets get-attributes --secret-key myusername
Vault location:C:\ProgramData\MathWorks\webapps\R2024b\config\webapps_private\webapps_secrets.xml
List of secret keys configured:
hostname --->myhost
port --->422
按范围列出机密
要设置具有特定范围的机密,请在系统命令行中输入:
webapps-secrets set mysecret2 97e846a4-a913-4a26 --scope $UserID
Vault location:C:\ProgramData\MathWorks\webapps\R2024b\config\webapps_private\webapps_secrets.xml
MATLAB Web App Server secrets configuration has been updated.
要列出所有当前配置的范围为 $UserID
的机密,请在系统命令行中输入:
webapps-secrets list --scope $UserID
Vault location:C:\ProgramData\MathWorks\webapps\R2024b\config\webapps_private\webapps_secrets.xml
List of secret keys configured:
scope:$UserID, secret key:mysecret2
列出所有机密
要列出所有当前配置的机密,请在系统命令行中输入:
webapps-secrets listAll
Vault location:C:\ProgramData\MathWorks\webapps\R2024b\config\webapps_private\webapps_secrets.xml
List of secret keys configured:
scope:<default>, secret key:myusername
scope:$UserID, secret key:mysecret2
显示帮助文本
要打印 webapps-secrets
帮助文本,请在系统命令行中输入:
webapps-secrets -h
Usage: webapps-secrets [--help | -h] Display this help message webapps-secrets [--version | -v] Display the version of MATLAB Web App Server webapps-secrets list [--scope <value>] List currently configured secret keys webapps-secrets listAll List all currently configured secret keys in all scopes webapps-secrets set <key> <value> [--scope <value>] [--mode Overwrite|FailIfExists] Set a secret to MATLAB Web App Server webapps-secrets remove <key> [--scope <value>] Remove a secret key from MATLAB Web App Server webapps-secrets set-attributes --secret-key <secret_key> [<attr_key> <attr_value>] [--scope <value>] [--mode Add|Merge|Replace] Set attributes of a secret to MATLAB Web App Server webapps-secrets get-attributes --secret-key <secret_key> [--scope <value>] Get attributes of a secret from MATLAB Web App Server
显示版本
要打印 MATLAB® Web App Server™ 版本信息,请在系统命令行中输入:
webapps-secrets -v
MATLAB Web App Server (R2024b)
输入参数
详细信息
版本历史记录
在 R2024a 中推出