Add JFrog OAuth and token examples to README

pull/97/head
Muhammad Atif Ali 2 years ago
parent 34979cdb64
commit b4ff6932be

@ -32,3 +32,27 @@ module "jfrog" {
## Prerequisites
- Coder [`external-auth`](https://docs.coder.com/docs/admin/external-auth/) configured with Artifactory. This requires a [custom integration](https://jfrog.com/help/r/jfrog-installation-setup-documentation/enable-new-integrations) in Artifactory with **Callback URL** set to `https://<your-coder-url>/external-auth/jfrog/callback`.
## Examples
Configure the Python pip package manager to fetch packages from Artifactory while mapping the Coder email to the Artifactory username.
```hcl
module "jfrog" {
source = "https://registry.coder.com/modules/jfrog-oauth"
agent_id = coder_agent.example.id
jfrog_url = "https://jfrog.example.com"
auth_method = "oauth"
username_field = "email"
package_managers = {
"pypi": "pypi"
}
}
```
You should now be able to install packages from Artifactory using both the `jf pip` and `pip` command.
```shell
jf pip install requests
pip install requests
```

@ -19,9 +19,9 @@ module "jfrog" {
jfrog_url = "https://YYYY.jfrog.io"
artifactory_access_token = var.artifactory_access_token # An admin access token
package_managers = {
"npm": "npm-remote",
"go": "go-remote",
"pypi": "pypi-remote"
"npm": "npm",
"go": "go",
"pypi": "pypi"
}
}
```
@ -54,3 +54,14 @@ module "jfrog" {
}
}
```
You should now be able to install packages from Artifactory using both the `jf npm`, `jf go`, `jf pip` and `npm`, `go`, `pip` command.
```shell
jf npm install prettier
jf go get github.com/golang/example/hello
jf pip install requests
npm install prettier
go get github.com/golang/example/hello
pip install requests
```

Loading…
Cancel
Save