Skip to content

Commit 7847944

Browse files
committed
De-vendorized oidc-discovery
1 parent 425c6b9 commit 7847944

File tree

8 files changed

+7
-217
lines changed

8 files changed

+7
-217
lines changed

.traefik.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import: github.com/alexdelprete/traefik-oidc-relying-party
1111
summary: This plugin for Traefik allows it to authenticate requests against an OpenID Provider. It utilizes the provider's client credentials flow to retrieve an access token, which is then set as a bearer token in the Authorization header of the incoming requests. The plugin communicates with the provider using the OpenID Connect protocol (OIDC).
1212

1313
# Medias associated to the plugin (optional)
14-
iconPath: foo/icon.png
15-
bannerPath: foo/banner.png
14+
# iconPath: foo/icon.png
15+
# bannerPath: foo/banner.png
1616

1717
# Configuration data for your plugin.
1818
# This is mandatory,

vendor/github.com/vexxhost/oidc-utils/pkg/discovery/client.go discovery_client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package discovery
1+
package traefik_oidc_relying_party
22

33
import (
44
"bytes"

vendor/github.com/vexxhost/oidc-utils/pkg/discovery/document.go discovery_doc.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package discovery
1+
package traefik_oidc_relying_party
22

33
type Endpoints struct {
44
BackchannelAuthenticationEndpoint string `json:"backchannel_authentication_endpoint"`

go.mod

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
module github.com/alexdelprete/traefik-oidc-relying-party
22

33
go 1.19
4-
5-
require github.com/vexxhost/oidc-utils v0.0.0-20230227152836-375a8f8ce8c3

go.sum

-2
This file was deleted.

main.go

+3-5
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import (
1010
"os"
1111
"strings"
1212
"time"
13-
14-
"github.com/vexxhost/oidc-utils/pkg/discovery"
1513
)
1614

1715
func (k *ProviderAuth) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
@@ -129,7 +127,7 @@ func (k *ProviderAuth) exchangeAuthCode(req *http.Request, authCode string, stat
129127
return "", err
130128
}
131129

132-
discoverydoc, err := discovery.DocumentFromIssuer(k.ProviderURL.String())
130+
discoverydoc, err := DocumentFromIssuer(k.ProviderURL.String())
133131
if err != nil {
134132
os.Stderr.WriteString("Error retrieving Discovery Document: " + err.Error())
135133
return "", err
@@ -180,7 +178,7 @@ func (k *ProviderAuth) redirectToProvider(rw http.ResponseWriter, req *http.Requ
180178
stateBytes, _ := json.Marshal(state)
181179
stateBase64 := base64.StdEncoding.EncodeToString(stateBytes)
182180

183-
discoverydoc, err := discovery.DocumentFromIssuer(k.ProviderURL.String())
181+
discoverydoc, err := DocumentFromIssuer(k.ProviderURL.String())
184182
if err != nil {
185183
os.Stderr.WriteString("Error retrieving Discovery Document: " + err.Error())
186184
}
@@ -211,7 +209,7 @@ func (k *ProviderAuth) verifyToken(token string) (bool, error) {
211209
"token": {token},
212210
}
213211

214-
discoverydoc, err := discovery.DocumentFromIssuer(k.ProviderURL.String())
212+
discoverydoc, err := DocumentFromIssuer(k.ProviderURL.String())
215213
if err != nil {
216214
os.Stderr.WriteString("Error retrieving Discovery Document: " + err.Error())
217215
}

vendor/github.com/vexxhost/oidc-utils/LICENSE

-201
This file was deleted.

vendor/modules.txt

-3
This file was deleted.

0 commit comments

Comments
 (0)