diff --git a/go.mod b/go.mod index 005f8a02e8e130b30492b75e8b27059c58d46e1c..88a624792fe18988ade50e69f225026b193d97ba 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/jinzhu/copier v0.3.2 github.com/jmoiron/sqlx v1.3.4 github.com/lestrrat-go/jwx v1.2.6 - github.com/oidc-mytoken/api v0.0.0-20210730065550-117f733ae8a1 + github.com/oidc-mytoken/api v0.3.1-0.20210921092134-2599cdd1db99 github.com/oidc-mytoken/lib v0.2.1-0.20210730094903-f59c9a8f84e0 github.com/pkg/errors v0.9.1 github.com/satori/go.uuid v1.2.0 diff --git a/go.sum b/go.sum index 3cd3fbf83c646dce2f4aabbd0573df5b35ff64de..3017baccd85d30119688e94a737af66d792dd2f0 100644 --- a/go.sum +++ b/go.sum @@ -415,6 +415,8 @@ github.com/nishanths/exhaustive v0.0.0-20200525081945-8e46705b6132 h1:NjznefjSrr github.com/nishanths/exhaustive v0.0.0-20200525081945-8e46705b6132/go.mod h1:wBEpHwM2OdmeNpdCvRPUlkEbBuaFmcK4Wv8Q7FuGW3c= github.com/oidc-mytoken/api v0.0.0-20210730065550-117f733ae8a1 h1:i1LIDAuTm4SR65iPjVq+elXHSKNju3Yt61+jreULTuE= github.com/oidc-mytoken/api v0.0.0-20210730065550-117f733ae8a1/go.mod h1:S8t1XA42EFAgc3vUfis0g1LPGA4TXH0nfDynvgo6cwk= +github.com/oidc-mytoken/api v0.3.1-0.20210921092134-2599cdd1db99 h1:0b66hU44d5wwcOpQhnilvIP0prVaQnZeaMLVCOYfAjQ= +github.com/oidc-mytoken/api v0.3.1-0.20210921092134-2599cdd1db99/go.mod h1:S8t1XA42EFAgc3vUfis0g1LPGA4TXH0nfDynvgo6cwk= github.com/oidc-mytoken/lib v0.2.1-0.20210730094903-f59c9a8f84e0 h1:eo1lEHaU6vkQZnAQyy7dA7JIoXpUOS/G4csV1LPIi80= github.com/oidc-mytoken/lib v0.2.1-0.20210730094903-f59c9a8f84e0/go.mod h1:2ITx3/ZTRyrR6GGIG3BfNdscxERXsD0Up8G3yZZDJng= github.com/oidc-mytoken/server v0.2.0/go.mod h1:6uFm+Za9NMK3gq4OOIeX3gs3T6leluVIWsGiM1zlQbA= diff --git a/internal/config/config.go b/internal/config/config.go index cc9ecb2f01d9ff0603dd2500737480702982d0e6..e37a2324fa90958548fedbae71611a9c81770cd8 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -7,7 +7,7 @@ import ( "github.com/coreos/go-oidc/v3/oidc" "github.com/pkg/errors" log "github.com/sirupsen/logrus" - yaml "gopkg.in/yaml.v3" + "gopkg.in/yaml.v3" model2 "github.com/oidc-mytoken/server/internal/model" "github.com/oidc-mytoken/server/internal/utils/errorfmt" @@ -76,9 +76,7 @@ var defaultConfig = Config{ PollingCodeExpiresAfter: 300, PollingInterval: 5, }, - TokenRotation: onlyEnable{true}, - AccessTokenGrant: onlyEnable{true}, - SignedJWTGrant: onlyEnable{true}, + TokenRotation: onlyEnable{true}, TokenInfo: tokeninfoConfig{ Introspect: onlyEnable{true}, History: onlyEnable{true}, @@ -120,8 +118,6 @@ type featuresConf struct { TransferCodes onlyEnable `yaml:"transfer_codes"` Polling pollingConf `yaml:"polling_codes"` TokenRotation onlyEnable `yaml:"token_rotation"` - AccessTokenGrant onlyEnable `yaml:"access_token_grant"` - SignedJWTGrant onlyEnable `yaml:"signed_jwt_grant"` TokenInfo tokeninfoConfig `yaml:"tokeninfo"` WebInterface onlyEnable `yaml:"web_interface"` DisabledRestrictionKeys model2.RestrictionKeys `yaml:"unsupported_restrictions"` diff --git a/internal/endpoints/configuration/configurationEndpoint.go b/internal/endpoints/configuration/configurationEndpoint.go index 1beb4f7ec37c2b3d3607ec0417baf4a0b26da963..fd31a90564b461e5fefb6ad2dae236bf97ebd010 100644 --- a/internal/endpoints/configuration/configurationEndpoint.go +++ b/internal/endpoints/configuration/configurationEndpoint.go @@ -41,8 +41,6 @@ func Init() { addShortTokens(mytokenConfig) addTransferCodes(mytokenConfig) addPollingCodes(mytokenConfig) - addAccessTokenGrant(mytokenConfig) - addSignedJWTGrant(mytokenConfig) addTokenInfo(mytokenConfig) } @@ -95,16 +93,6 @@ func addPollingCodes(mytokenConfig *pkg.MytokenConfiguration) { pkgModel.GrantTypePollingCode.AddToSliceIfNotFound(&mytokenConfig.MytokenEndpointGrantTypesSupported) } } -func addAccessTokenGrant(mytokenConfig *pkg.MytokenConfiguration) { - if config.Get().Features.AccessTokenGrant.Enabled { - pkgModel.GrantTypeAccessToken.AddToSliceIfNotFound(&mytokenConfig.MytokenEndpointGrantTypesSupported) - } -} -func addSignedJWTGrant(mytokenConfig *pkg.MytokenConfiguration) { - if config.Get().Features.SignedJWTGrant.Enabled { - pkgModel.GrantTypePrivateKeyJWT.AddToSliceIfNotFound(&mytokenConfig.MytokenEndpointGrantTypesSupported) - } -} func addTokenInfo(mytokenConfig *pkg.MytokenConfiguration) { if !config.Get().Features.TokenInfo.Enabled { mytokenConfig.TokeninfoEndpoint = "" diff --git a/internal/endpoints/token/mytoken/mytokenEndpoint.go b/internal/endpoints/token/mytoken/mytokenEndpoint.go index 996671227e3a44febd15826e15d19df612148240..2e26d655e7025d6385e7d5816101da4f619e1d4c 100644 --- a/internal/endpoints/token/mytoken/mytokenEndpoint.go +++ b/internal/endpoints/token/mytoken/mytokenEndpoint.go @@ -34,14 +34,6 @@ func HandleMytokenEndpoint(ctx *fiber.Ctx) error { if config.Get().Features.Polling.Enabled { return polling.HandlePollingCode(ctx) } - case model.GrantTypeAccessToken: - if config.Get().Features.AccessTokenGrant.Enabled { - return serverModel.ResponseNYI.Send(ctx) - } - case model.GrantTypePrivateKeyJWT: - if config.Get().Features.SignedJWTGrant.Enabled { - return serverModel.ResponseNYI.Send(ctx) - } case model.GrantTypeTransferCode: if config.Get().Features.TransferCodes.Enabled { return mytoken.HandleMytokenFromTransferCode(ctx).Send(ctx) diff --git a/shared/model/grantType.go b/shared/model/grantType.go index 4636da9d0a6a5ddffd9d9f63fbceda9d88e13233..5f2eaa5da36cef74c111964c3e004609c11297e1 100644 --- a/shared/model/grantType.go +++ b/shared/model/grantType.go @@ -5,7 +5,7 @@ import ( "github.com/oidc-mytoken/api/v0" "github.com/pkg/errors" - yaml "gopkg.in/yaml.v3" + "gopkg.in/yaml.v3" ) // GrantType is an enum like type for grant types @@ -19,8 +19,6 @@ const ( // assert that these are in the same order as api.AllGrantTypes GrantTypeMytoken GrantType = iota GrantTypeOIDCFlow GrantTypePollingCode - GrantTypeAccessToken - GrantTypePrivateKeyJWT GrantTypeTransferCode maxGrantType )