Skip to content

Commit

Permalink
fix: Implement dedicated error for RevokeToken (#508)
Browse files Browse the repository at this point in the history
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
  • Loading branch information
jkroepke authored Jan 8, 2024
1 parent c37ca25 commit e23b1d4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 5 additions & 0 deletions pkg/client/rp/errors.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package rp

import "errors"

var ErrRelyingPartyNotSupportRevokeCaller = errors.New("RelyingParty does not support RevokeCaller")
5 changes: 2 additions & 3 deletions pkg/client/rp/relying_party.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ import (
"context"
"encoding/base64"
"errors"
"fmt"
"net/http"
"net/url"
"time"

jose "github.com/go-jose/go-jose/v3"
"github.com/go-jose/go-jose/v3"
"github.com/google/uuid"
"github.com/zitadel/logging"
"golang.org/x/exp/slog"
Expand Down Expand Up @@ -726,5 +725,5 @@ func RevokeToken(ctx context.Context, rp RelyingParty, token string, tokenTypeHi
if rc, ok := rp.(client.RevokeCaller); ok && rc.GetRevokeEndpoint() != "" {
return client.CallRevokeEndpoint(ctx, request, nil, rc)
}
return fmt.Errorf("RelyingParty does not support RevokeCaller")
return ErrRelyingPartyNotSupportRevokeCaller
}

0 comments on commit e23b1d4

Please sign in to comment.