From d832ea7304a2755beff8b7b27310ed444701b974 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Tue, 4 Apr 2023 17:00:04 -0600 Subject: [PATCH] chore: go fmt --- chiauth/chiauth.go | 19 +++++++++---------- libauth.go | 8 +++++--- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/chiauth/chiauth.go b/chiauth/chiauth.go index 815bfc7..305eec6 100644 --- a/chiauth/chiauth.go +++ b/chiauth/chiauth.go @@ -28,17 +28,16 @@ type VerificationParams struct { // NewTokenVerifier returns a token-verifying middleware // -// tokenVerifier := chiauth.NewTokenVerifier(chiauth.VerificationParams{ -// Issuers: keyfetch.Whitelist([]string{"https://accounts.google.com"}), -// Optional: false, -// }) -// r.Use(tokenVerifier) -// -// r.Post("/api/users/profile", func(w http.ResponseWriter, r *http.Request) { -// ctx := r.Context() -// jws, ok := ctx.Value(chiauth.JWSKey).(*libauth.JWS) -// }) +// tokenVerifier := chiauth.NewTokenVerifier(chiauth.VerificationParams{ +// Issuers: keyfetch.Whitelist([]string{"https://accounts.google.com"}), +// Optional: false, +// }) +// r.Use(tokenVerifier) // +// r.Post("/api/users/profile", func(w http.ResponseWriter, r *http.Request) { +// ctx := r.Context() +// jws, ok := ctx.Value(chiauth.JWSKey).(*libauth.JWS) +// }) func NewTokenVerifier(opts VerificationParams) func(http.Handler) http.Handler { return func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { diff --git a/libauth.go b/libauth.go index cdfdcae..da39c0b 100644 --- a/libauth.go +++ b/libauth.go @@ -28,8 +28,9 @@ type IssuerList = keyfetch.Whitelist // create a trusted IssuerList of public and/or internal issuer URLs. // // Example: -// OIDC_ISSUERS='https://example.com/ https://therootcompany.github.io/libauth/' -// OIDC_ISSUERS_INTERNAL='http://localhost:3000/ http://my-service-name:8080/' +// +// OIDC_ISSUERS='https://example.com/ https://therootcompany.github.io/libauth/' +// OIDC_ISSUERS_INTERNAL='http://localhost:3000/ http://my-service-name:8080/' func ParseIssuerEnvs(issuersEnvName, internalEnvName string) (IssuerList, error) { if len(issuersEnvName) > 0 { issuersEnvName = oidcIssuersEnv @@ -49,7 +50,8 @@ func ParseIssuerEnvs(issuersEnvName, internalEnvName string) (IssuerList, error) // ParseIssuerListString will Split comma- and/or space-delimited list into a slice // // Example: -// "https://example.com/, https://therootcompany.github.io/libauth/" +// +// "https://example.com/, https://therootcompany.github.io/libauth/" func ParseIssuerListString(issuerList string) []string { issuers := []string{}