Complete KeyCape service-token rollout
All checks were successful
Build and Publish Container Image / build-and-push (push) Successful in 25s

This commit is contained in:
tegwick 2026-07-27 20:17:55 +02:00
parent f4a2f7eb1e
commit 881fffc079
4 changed files with 26 additions and 11 deletions

View file

@ -182,7 +182,7 @@ func DefaultRegistry() *Registry {
reg.Register(UnsupportedFeature{
Name: "unknown_grant_type",
ErrorType: profileerrors.ErrFeatureNotSupported,
Description: "Only authorization_code and refresh_token grant types are supported.",
Description: "Only authorization_code and client_credentials grant types are supported.",
Detector: func(r *http.Request) bool {
if r.Method != http.MethodPost || !strings.HasSuffix(r.URL.Path, "/token") {
return false
@ -195,7 +195,7 @@ func DefaultRegistry() *Registry {
if gt == "" {
return false // no grant_type present; let the handler decide
}
return gt != "authorization_code" && gt != "refresh_token"
return gt != "authorization_code" && gt != "client_credentials"
},
})

View file

@ -155,7 +155,7 @@ func TestDefaultRegistry_UnknownGrantType(t *testing.T) {
em := newRecEmitter()
handler := reg.Middleware(alwaysOK())
w := serve(handler, reqWithEmitter(http.MethodPost, "/token?grant_type=client_credentials", em))
w := serve(handler, reqWithEmitter(http.MethodPost, "/token?grant_type=password", em))
assertProfileError(t, w, profileerrors.ErrFeatureNotSupported, "unknown_grant_type")
assertTelemetryEmitted(t, em, "unknown_grant_type")
@ -165,7 +165,7 @@ func TestDefaultRegistry_UnknownGrantType_AllowedTypes(t *testing.T) {
reg := serverrors.DefaultRegistry()
handler := reg.Middleware(alwaysOK())
for _, gt := range []string{"authorization_code", "refresh_token"} {
for _, gt := range []string{"authorization_code", "client_credentials"} {
req := reqWithEmitter(http.MethodPost, "/token?grant_type="+gt, newRecEmitter())
w := serve(handler, req)
if w.Code != http.StatusOK {