Skip to content

newrelic/newrelic-auth-rs

New Relic Open Source community project banner.

⚠️ nr-auth is in preview and licensed under the New Relic Pre-Release Software Notice.

nr-auth

nr-auth aims to provide all the functionality needed to authenticate with System Identity Service and retrieve authorization tokens to make authenticated and authorized requests to Fleet Control.

Installation

The library is not available on crates.io for now, but you can still use it from this repository by adding the following line to your project's Cargo.toml:

[dependencies]
nr-auth = { git = "https://github.com/newrelic/newrelic-auth-rs.git", tag = "0.0.4" }

Getting Started

See the documentation documentation for details.

Usage

There is a Docker image available to use the CLI without installing it locally or building from source:

docker run newrelic/agent-control-system-identity-registration:nightly [...]

Notice that you might need to mount a volume to provide access to your private key file.

docker run -v /our/pey/path:/private-key.pem  newrelic/agent-control-system-identity-registration:nightly [...] --private-key-path /private-key.pem

Authentication Command Usage:

# Authenticate using a client secret
newrelic_auth_cli authenticate --client-id your_client_id --environment STAGING --client-secret your_client_secret --output-token-format JSON
# Authenticate using a private key
newrelic_auth_cli authenticate --client-id your_client_id --environment STAGING --private-key-path /path/to/key.pem --output-token-format PLAIN

Create Identity Command Usage:

# Create a "secret" type identity using an access token
newrelic_auth_cli create-identity secret --name test1 --client-id your_client_id --organization-id your_org_id --environment US --client-secret your_secret --bearer-access-token your_access_token
# Create a "key" type identity using an access token
newrelic_auth_cli create-identity key --name test --client-id your_client_id --organization-id your_org_id --environment EU --bearer-access-token your_access_token --output-local-path /path/to/store/private_key.pem

Notice that the command support proxy:

HTTPS_PROXY=https://localhost:8080 newrelic_auth_cli [...]

Support

  • New Relic Community: The best place to engage in troubleshooting questions.
  • Issues: If you find any problems while using the library, feel free to open an issue where the New Relic maintainers of this project will be able to help.

Contribute

We encourage your contributions to improve [project name]! Keep in mind that when you submit your pull request, you'll need to sign the CLA via the click-through using CLA-Assistant. You only have to sign the CLA one time per project.

If you have any questions, or to execute our corporate CLA (which is required if your contribution is on behalf of a company), drop us an email at [email protected].

A note about vulnerabilities

As noted in our security policy, New Relic is committed to the privacy and security of our customers and their data. We believe that providing coordinated disclosure by security researchers and engaging with the security community are important means to achieve our security goals.

If you believe you have found a security vulnerability in this project or any of New Relic's products or websites, we welcome and greatly appreciate you reporting it to New Relic through our bug bounty program.

If you would like to contribute to this project, review these guidelines.

To all contributors, we thank you! Without your contribution, this project would not be what it is today.

License

newrelic-auth-rs is licensed under the New Relic Prerelease Software License.

This project also uses source code from third-party libraries. You can find full details on which libraries are used and the terms under which they are licensed in the third-party notices document.

Upstream archive

Link (private, for NR employees).

About

NR System Identity Service authentication in Rust

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors 13

Languages