Skip to content

Commit

Permalink
chore: document custom JWKs in broadcast endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-jonas committed Jul 9, 2024
1 parent eeaf6f0 commit 5b3120c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
3 changes: 3 additions & 0 deletions jwk/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ func (h *Handler) SetRoutes(admin *httprouterx.RouterAdmin, public *httprouterx.
// if enabled, OAuth 2.0 JWT Access Tokens. This endpoint can be used with client libraries like
// [node-jwks-rsa](https://github.com/auth0/node-jwks-rsa) among others.
//
// Adding custom keys requires first creating a keyset via the createJsonWebKeySet operation,
// and then configuring the webfinger.jwks.broadcast_keys configuration value to include the keyset name.
//
// Consumes:
// - application/json
//
Expand Down
14 changes: 7 additions & 7 deletions jwk/manager_strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (m ManagerStrategy) GenerateAndPersistKeySet(ctx context.Context, set, kid,
}

func (m ManagerStrategy) AddKey(ctx context.Context, set string, key *jose.JSONWebKey) error {
ctx, span := otel.GetTracerProvider().Tracer(tracingComponent).Start(ctx, "jwk.GenerateAndPersistKeySet")
ctx, span := otel.GetTracerProvider().Tracer(tracingComponent).Start(ctx, "jwk.AddKey")
defer span.End()
attrs := map[string]string{
"set": set,
Expand All @@ -54,7 +54,7 @@ func (m ManagerStrategy) AddKey(ctx context.Context, set string, key *jose.JSONW
}

func (m ManagerStrategy) AddKeySet(ctx context.Context, set string, keys *jose.JSONWebKeySet) error {
ctx, span := otel.GetTracerProvider().Tracer(tracingComponent).Start(ctx, "jwk.GenerateAndPersistKeySet")
ctx, span := otel.GetTracerProvider().Tracer(tracingComponent).Start(ctx, "jwk.AddKeySet")
defer span.End()
attrs := map[string]string{
"set": set,
Expand All @@ -65,7 +65,7 @@ func (m ManagerStrategy) AddKeySet(ctx context.Context, set string, keys *jose.J
}

func (m ManagerStrategy) UpdateKey(ctx context.Context, set string, key *jose.JSONWebKey) error {
ctx, span := otel.GetTracerProvider().Tracer(tracingComponent).Start(ctx, "jwk.GenerateAndPersistKeySet")
ctx, span := otel.GetTracerProvider().Tracer(tracingComponent).Start(ctx, "jwk.UpdateKey")
defer span.End()
attrs := map[string]string{
"set": set,
Expand All @@ -76,7 +76,7 @@ func (m ManagerStrategy) UpdateKey(ctx context.Context, set string, key *jose.JS
}

func (m ManagerStrategy) UpdateKeySet(ctx context.Context, set string, keys *jose.JSONWebKeySet) error {
ctx, span := otel.GetTracerProvider().Tracer(tracingComponent).Start(ctx, "jwk.GenerateAndPersistKeySet")
ctx, span := otel.GetTracerProvider().Tracer(tracingComponent).Start(ctx, "jwk.UpdateKeySet")
defer span.End()
attrs := map[string]string{
"set": set,
Expand All @@ -87,7 +87,7 @@ func (m ManagerStrategy) UpdateKeySet(ctx context.Context, set string, keys *jos
}

func (m ManagerStrategy) GetKey(ctx context.Context, set, kid string) (*jose.JSONWebKeySet, error) {
ctx, span := otel.GetTracerProvider().Tracer(tracingComponent).Start(ctx, "jwk.GenerateAndPersistKeySet")
ctx, span := otel.GetTracerProvider().Tracer(tracingComponent).Start(ctx, "jwk.GetKey")
defer span.End()
attrs := map[string]string{
"set": set,
Expand All @@ -106,7 +106,7 @@ func (m ManagerStrategy) GetKey(ctx context.Context, set, kid string) (*jose.JSO
}

func (m ManagerStrategy) GetKeySet(ctx context.Context, set string) (*jose.JSONWebKeySet, error) {
ctx, span := otel.GetTracerProvider().Tracer(tracingComponent).Start(ctx, "jwk.GenerateAndPersistKeySet")
ctx, span := otel.GetTracerProvider().Tracer(tracingComponent).Start(ctx, "jwk.GetKeySet")
defer span.End()
attrs := map[string]string{
"set": set,
Expand Down Expand Up @@ -143,7 +143,7 @@ func (m ManagerStrategy) DeleteKey(ctx context.Context, set, kid string) error {
}

func (m ManagerStrategy) DeleteKeySet(ctx context.Context, set string) error {
ctx, span := otel.GetTracerProvider().Tracer(tracingComponent).Start(ctx, "jwk.GenerateAndPersistKeySet")
ctx, span := otel.GetTracerProvider().Tracer(tracingComponent).Start(ctx, "jwk.DeleteKeySet")
defer span.End()
attrs := map[string]string{
"set": set,
Expand Down

0 comments on commit 5b3120c

Please sign in to comment.