diff --git a/mjwt.go b/mjwt.go index e203dfc..7a9bd60 100644 --- a/mjwt.go +++ b/mjwt.go @@ -12,6 +12,7 @@ var ErrClaimTypeMismatch = errors.New("claim type mismatch") type Provider interface { GenerateJwt(sub, id string, dur time.Duration, claims Claims) (string, error) + SignJwt(claims jwt.Claims) (string, error) VerifyJwt(token string, claims baseTypeClaim) (*jwt.Token, error) Issuer() string } diff --git a/verifier.go b/verifier.go index 739c73d..c38af89 100644 --- a/verifier.go +++ b/verifier.go @@ -45,6 +45,10 @@ func (d *defaultMJwtVerifier) GenerateJwt(_, _ string, _ time.Duration, _ Claims return "", ErrCannotGenerateMJwtToken } +func (d *defaultMJwtVerifier) SignJwt(_ jwt.Claims) (string, error) { + return "", ErrCannotGenerateMJwtToken +} + func (d *defaultMJwtVerifier) VerifyJwt(token string, claims baseTypeClaim) (*jwt.Token, error) { withClaims, err := jwt.ParseWithClaims(token, claims, func(token *jwt.Token) (interface{}, error) { return d.pub, nil