JohnsonControls.MetasysSecrets
1.0.0-alpha2
dotnet tool install --global JohnsonControls.MetasysSecrets --version 1.0.0-alpha2
dotnet new tool-manifest # if you are setting up this repo dotnet tool install --local JohnsonControls.MetasysSecrets --version 1.0.0-alpha2
#tool dotnet:?package=JohnsonControls.MetasysSecrets&version=1.0.0-alpha2&prerelease
nuke :add-package JohnsonControls.MetasysSecrets --version 1.0.0-alpha2
Metasys Secrets
A cli for adding metasys passwords to your operating system credential manager.
These credentials can then be retrieved by your applications and the password
can be securely passed to MetasysClient.TryLogin
method of
basic-services-dotnet.
Usage
There are three subcommands add
, lookup
and delete
as shown below. Each
takes a hostName
and userName
for arguments.
metasys-secrets add <hostName> <userName>
metasys-secrets lookup <hostName> <userName>
metasys-secrets delete <hostName> <userName>
Examples
In these examples we'll assume that the hostName
is
my-ads-server.company.com
and the userName
is api-service-account
.
Save a Password
To save the password
> metasys-secrets add my-ads-server.company.com api-service-account
Enter your password: *******
Notice you are prompted for your password. If you really want to do it all on one line you can do it like this.
echo "thepassword" | metasys-secrets add my-ads-server.company.com api-service-account
[!Warning]
Be careful with this approach as your password is now shown in plain text and will be stored in your shell history. It's not recommended for production environments.
Delete a Password
To delete a password from your credential manager you can do
metasys-secrets delete <hostName> <userName>
Display a Password
To read a password from the credential manager you can do
metasys-secrets lookup <hostName> <userName>
[!Warning]
Be careful with this approach as your password is now shown in plain text.It's not recommended for production environments. You may choose to use the GUI tool for your operating system instead.
Credential Managers
The credential manager that is used depends on the operating system you are using.
Windows
On Windows the passwords are saved in the Windows Credential Manager.
macOS
On macOS the passwords are saved in the macOS Keychain
Linux
On Linux the passwords are saved using libsecret
and it relies on the linux
command line tool secret-tool
. To install that tool depends on the
distribution you are using.
On Debian/Ubuntu you can install it like this
sudo apt install libsecret-tools
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
This package has no dependencies.
Version | Downloads | Last updated |
---|---|---|
1.0.0-alpha2 | 66 | 7/31/2024 |
Initial Release for macOS, Linux and Windows. The Linux version has a dependency on libsecret-tools