diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml index ddfd46bbc..1dbe808bb 100644 --- a/.github/workflows/spec.yml +++ b/.github/workflows/spec.yml @@ -29,7 +29,7 @@ jobs: - name: create spec run: | - sudo make spec-install + make spec-install make spec - name: upload spec diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 4197e5785..8d9e58e02 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -43,5 +43,5 @@ jobs: - name: validate spec run: | - sudo make spec-install + make spec-install make spec diff --git a/Makefile b/Makefile index 83527e308..7c7a3ca31 100644 --- a/Makefile +++ b/Makefile @@ -279,11 +279,10 @@ spec-install: $(if $(shell command -v apt-get 2> /dev/null),,$(error 'apt-get' not found - install jq, sponge, and go-swagger manually)) @echo @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 + @sudo apt-get update + @sudo apt-get install -y jq moreutils + @echo "### Installing go-swagger" + @go install github.com/go-swagger/go-swagger/cmd/swagger@v0.31.0 # 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 9d58a3a8b..acd082951 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 b4562a9bd..c6ba560e7 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. @@ -40,9 +39,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"` }