Skip to content
This repository has been archived by the owner on Feb 16, 2022. It is now read-only.

Commit

Permalink
Merge pull request #210 from twistedstream/support-dotenv
Browse files Browse the repository at this point in the history
Add .env config file support
  • Loading branch information
Yvo authored Apr 9, 2021
2 parents a4cb952 + 364ebe4 commit 1ba535b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,7 @@ vendor/
### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide
.ionide

### Local .env file
.env
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,17 @@ The following Auth0 resources are supported:
- [x] [Tickets](https://auth0.com/docs/api/management/v2#!/Tickets/post_email_verification)
- [x] [Signing Keys](https://auth0.com/docs/api/management/v2#!/Keys/get_signing_keys)

### Tests

The tests must run against an Auth0 tenant. They also need an [M2M app](https://auth0.com/docs/applications/set-up-an-application/register-machine-to-machine-applications) in that tenant that has been authorized to call the Management API. You can easily set one of these up by creating an [API Explorer Application](https://auth0.com/docs/tokens/management-api-access-tokens/create-and-authorize-a-machine-to-machine-application) in your tenant.

Then simply create a local `.env` file with the following settings:

* `AUTH0_DOMAIN`: The **Domain** of the M2M app
* `AUTH0_CLIENT_ID`: The **Client ID** of the M2M app
* `AUTH0_CLIENT_SECRET`: The **Client Secret** of the M2M app
* `AUTH0_DEBUG`: Set to `true` to call the Management API in debug mode, which dumps the HTTP requests and responses to the output

## What is Auth0?

Auth0 helps you to:
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ require (
github.com/aybabtme/iocontrol v0.0.0-20150809002002-ad15bcfc95a0 // indirect
github.com/benbjohnson/clock v1.0.3 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/joho/godotenv v1.3.0 // indirect
github.com/stretchr/testify v1.4.0
golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43
)
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
Expand Down
2 changes: 2 additions & 0 deletions management/management_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
"time"

"gopkg.in/auth0.v5/internal/testing/expect"

_ "github.com/joho/godotenv/autoload"
)

var m *Management
Expand Down

0 comments on commit 1ba535b

Please sign in to comment.