Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: expose cache metrics #3

Merged
merged 1 commit into from
Jan 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion oidc/oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ var supportedAlgorithms = map[string]bool{
// parsing.
//
// // Directly fetch the metadata document.
// resp, err := http.Get("https://login.example.com/custom-metadata-path")
// resp, err := http.Get("https://login.example.com/custom-metadata-path")
// if err != nil {
// // ...
// }
Expand Down Expand Up @@ -234,6 +234,11 @@ var oidcConfigCache, _ = ristretto.NewCache(&ristretto.Config[string, []byte]{
BufferItems: 64,
})

// GetCacheMetrics returns the cache metrics for the OpenID Connect discovery cache.
func GetCacheMetrics() *ristretto.Metrics {
return oidcConfigCache.Metrics
}

// NewProvider uses the OpenID Connect discovery mechanism to construct a Provider.
// The issuer is the URL identifier for the service. For example: "https://accounts.google.com"
// or "https://login.salesforce.com".
Expand Down
Loading