Skip to content

Commit

Permalink
feat: support OAuth 2.0 Client Credentials auth (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
svrakitin committed Jun 28, 2022
1 parent 6602eea commit 93502c8
Show file tree
Hide file tree
Showing 7 changed files with 301 additions and 393 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.36
version: v1.46.2
- name: Run services
run: docker-compose up -d
- name: Test
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3"
services:
hydra:
image: oryd/hydra:v1.10.7
image: oryd/hydra:v1.11.8
environment:
DSN: postgres://hydra:hydra@hydra-postgres:5432/hydra?sslmode=disable
ports:
Expand All @@ -14,7 +14,7 @@ services:
- hydra-migrate
restart: unless-stopped
hydra-migrate:
image: oryd/hydra:v1.10.7
image: oryd/hydra:v1.11.8
command: migrate -c /etc/hydra/config.yaml sql -e --yes
environment:
DSN: postgres://hydra:hydra@hydra-postgres:5432/hydra?sslmode=disable
Expand Down
23 changes: 18 additions & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ provider "hydra" {
```

<!-- schema generated by tfplugindocs -->

## Schema

### Required
Expand All @@ -34,25 +33,39 @@ provider "hydra" {
- **authentication** (Block List, Max: 1) Optional block to specify an authentication method which is used to access Hydra Admin API. (see [below for nested schema](#nestedblock--authentication))

<a id="nestedblock--authentication"></a>

### Nested Schema for `authentication`

Optional:

- **basic** (Block List, Max: 1) (see [below for nested schema](#nestedblock--authentication--basic))
- **oauth2** (Block List, Max: 1) (see [below for nested schema](#nestedblock--authentication--oauth2))
- **tls** (Block List, Max: 1) (see [below for nested schema](#nestedblock--authentication--tls))

<a id="nestedblock--authentication--basic"></a>

### Nested Schema for `authentication.basic`

Required:

- **password** (String, Sensitive)
- **username** (String)

<a id="nestedblock--authentication--tls"></a>

<a id="nestedblock--authentication--oauth2"></a>
### Nested Schema for `authentication.oauth2`

Required:

- **client_id** (String) Client ID
- **client_secret** (String, Sensitive) Client Secret
- **token_endpoint** (String) Token endpoint to request an access token

Optional:

- **audience** (List of String) Audience for an issued access token
- **scopes** (List of String) Scopes for an issued access token


<a id="nestedblock--authentication--tls"></a>
### Nested Schema for `authentication.tls`

Required:
Expand All @@ -62,4 +75,4 @@ Required:

Optional:

- **insecure_skip_verify** (Boolean) Controls whether a client verifies the server's certificate chain and host name.
- **insecure_skip_verify** (Boolean) Controls whether a client verifies the server's certificate chain and host name.
86 changes: 41 additions & 45 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,42 +11,43 @@ require (
github.com/go-stack/stack v1.8.1 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2
github.com/hashicorp/go-hclog v1.0.0 // indirect
github.com/hashicorp/go-hclog v1.2.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-plugin v1.4.3 // indirect
github.com/hashicorp/go-uuid v1.0.2 // indirect
github.com/hashicorp/hcl/v2 v2.10.1 // indirect
github.com/hashicorp/terraform-plugin-docs v0.4.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.8.0
github.com/hashicorp/go-plugin v1.4.4 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/hcl/v2 v2.12.0 // indirect
github.com/hashicorp/terraform-plugin-docs v0.10.1
github.com/hashicorp/terraform-plugin-sdk/v2 v2.17.0
github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.11 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.4.2
github.com/mitchellh/mapstructure v1.5.0
github.com/oklog/run v1.1.0 // indirect
github.com/ory/hydra-client-go v1.10.6
github.com/zclconf/go-cty v1.10.0 // indirect
go.mongodb.org/mongo-driver v1.7.4 // indirect
golang.org/x/net v0.0.0-20211101193420-4a448f8816b3 // indirect
golang.org/x/sys v0.0.0-20211103235746-7861aae1554b // indirect
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20211102202547-e9cf271f7f2c // indirect
google.golang.org/grpc v1.42.0 // indirect
google.golang.org/grpc v1.46.0 // indirect
)

require (
cloud.google.com/go v0.61.0 // indirect
cloud.google.com/go/storage v1.10.0 // indirect
github.com/Masterminds/goutils v1.1.0 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
github.com/Masterminds/sprig v2.22.0+incompatible // indirect
github.com/stretchr/testify v1.7.0
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
)

require (
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.1.1 // indirect
github.com/Masterminds/sprig/v3 v3.2.2 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310 // indirect
github.com/aws/aws-sdk-go v1.34.28 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/bgentry/speakeasy v0.1.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-openapi/errors v0.20.1 // indirect
Expand All @@ -57,45 +58,40 @@ require (
github.com/go-openapi/strfmt v0.21.0 // indirect
github.com/go-openapi/swag v0.19.15 // indirect
github.com/go-openapi/validate v0.20.3 // indirect
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/uuid v1.1.2 // indirect
github.com/googleapis/gax-go/v2 v2.0.5 // indirect
github.com/google/go-cmp v0.5.8 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/hashicorp/go-checkpoint v0.5.0 // indirect
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect
github.com/hashicorp/go-getter v1.5.3 // indirect
github.com/hashicorp/go-safetemp v1.0.0 // indirect
github.com/hashicorp/go-version v1.3.0 // indirect
github.com/hashicorp/go-version v1.5.0 // indirect
github.com/hashicorp/hc-install v0.3.2 // indirect
github.com/hashicorp/logutils v1.0.0 // indirect
github.com/hashicorp/terraform-exec v0.14.0 // indirect
github.com/hashicorp/terraform-json v0.12.0 // indirect
github.com/hashicorp/terraform-plugin-go v0.4.0 // indirect
github.com/hashicorp/terraform-exec v0.16.1 // indirect
github.com/hashicorp/terraform-json v0.14.0 // indirect
github.com/hashicorp/terraform-plugin-go v0.9.1 // indirect
github.com/hashicorp/terraform-plugin-log v0.4.0 // indirect
github.com/hashicorp/terraform-registry-address v0.0.0-20210412075316-9b2996cce896 // indirect
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/jstemmer/go-junit-report v0.9.1 // indirect
github.com/klauspost/compress v1.13.6 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mitchellh/cli v1.1.2 // indirect
github.com/mitchellh/cli v1.1.4 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/posener/complete v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/posener/complete v1.2.3 // indirect
github.com/russross/blackfriday v1.6.0 // indirect
github.com/ulikunitz/xz v0.5.8 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
go.opencensus.io v0.22.4 // indirect
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b // indirect
golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect
golang.org/x/mod v0.3.0 // indirect
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect
github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect
github.com/vmihailenco/tagparser v0.1.1 // indirect
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/tools v0.0.0-20200713011307-fd294ab11aed // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/api v0.29.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0 // indirect
)
Loading

0 comments on commit 93502c8

Please sign in to comment.