mirror of
https://forgejo.merr.is/annika/isl-api.git
synced 2025-12-13 04:56:50 -05:00
This can verify a JWT using the JWKS fetched from an OAuth's endpoint.
This commit is contained in:
parent
d4b2d5fefb
commit
ac18b94a86
6 changed files with 173 additions and 10 deletions
|
|
@ -1,6 +1,28 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"log/slog"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type EnvConfigs struct {
|
||||
HttpPort string `mapstructure:"HTTP_PORT"`
|
||||
ConnectionString string `mapstructure:"DB_CONNECTION_STRING"`
|
||||
JWKSURI string `mapstructure:"JWKS_URI"`
|
||||
LogLevel string `mapstructure:"LOG_LEVEL"`
|
||||
}
|
||||
|
||||
func (ec *EnvConfigs) GetLogLevel() slog.Level {
|
||||
switch strings.ToLower(ec.LogLevel) {
|
||||
case "debug":
|
||||
return slog.LevelDebug
|
||||
case "info":
|
||||
return slog.LevelInfo
|
||||
case "warn":
|
||||
return slog.LevelWarn
|
||||
case "error":
|
||||
return slog.LevelError
|
||||
default:
|
||||
return slog.LevelInfo
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue