-
-
Notifications
You must be signed in to change notification settings - Fork 604
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
147 changed files
with
24,976 additions
and
936 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,17 @@ | ||
package jwks | ||
|
||
import ( | ||
"context" | ||
"errors" | ||
) | ||
|
||
var ( | ||
// ErrEmptyKeyID raises when input kid is empty. | ||
ErrEmptyKeyID = errors.New("cache: empty kid") | ||
// ErrCacheNotFound raises when cache value not found. | ||
// ErrCacheNotFound returned when cache value not found. | ||
ErrCacheNotFound = errors.New("cache: value not found") | ||
// ErrInvalidValue raises when type conversion to JWK has been failed. | ||
ErrInvalidValue = errors.New("cache: invalid value") | ||
) | ||
|
||
// Cache works with cache layer. | ||
type Cache interface { | ||
Add(ctx context.Context, key *JWK) error | ||
Get(ctx context.Context, kid string) (*JWK, error) | ||
Len(ctx context.Context) (int, error) | ||
Add(key *JWK) error | ||
Get(kid string) (*JWK, error) | ||
Len() (int, error) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.