diff --git a/Makefile b/Makefile index 83527e308..c597ea922 100644 --- a/Makefile +++ b/Makefile @@ -281,9 +281,8 @@ spec-install: @echo "### Installing utilities (jq and sponge)" @apt-get update @apt-get install -y jq moreutils - @echo "### Downloading and installing go-swagger" - @curl -o /usr/local/bin/swagger -L "https://github.com/go-swagger/go-swagger/releases/download/v0.30.2/swagger_linux_amd64" - @chmod +x /usr/local/bin/swagger + @echo "### Installing go-swagger" + @go install github.com/go-swagger/go-swagger/cmd/swagger@latest # The `spec-gen` target is intended to create an api-spec # using go-swagger (https://goswagger.io) diff --git a/api/jwks.go b/api/jwks.go index 166ccc15d..fb826048d 100644 --- a/api/jwks.go +++ b/api/jwks.go @@ -21,8 +21,6 @@ import ( // produces: // - application/json // parameters: -// security: -// - ApiKeyAuth: [] // responses: // '200': // description: Successfully retrieved the Vela JWKS diff --git a/api/oi_config.go b/api/oi_config.go index c7f9307b2..6112fd4df 100644 --- a/api/oi_config.go +++ b/api/oi_config.go @@ -22,8 +22,6 @@ import ( // produces: // - application/json // parameters: -// security: -// - ApiKeyAuth: [] // responses: // '200': // description: Successfully retrieved the Vela OpenID Configuration diff --git a/api/types/oidc.go b/api/types/oidc.go index e472c3a42..359178244 100644 --- a/api/types/oidc.go +++ b/api/types/oidc.go @@ -4,7 +4,6 @@ package types import ( "github.com/golang-jwt/jwt/v5" - "github.com/lestrrat-go/jwx/v2/jwk" ) // OpenIDConfig is a struct that represents the OpenID Connect configuration. @@ -37,9 +36,17 @@ type OpenIDClaims struct { jwt.RegisteredClaims } -// JWKSet is a wrapper of lestrrat-go/jwx/jwk.Set for API Swagger gen. +// JWKSet exists solely to provide proper swagger documentation. +// It is not otherwise used in code. // // swagger:model JWKSet type JWKSet struct { - jwk.Set + Keys []JWK `json:"keys"` +} + +type JWK struct { + Kty string `json:"kty"` + Kid string `json:"kid"` + E string `json:"e"` + N string `json:"n"` }