Hardcode keibi's prefix to /auth

This commit is contained in:
Zoe Roux 2025-05-19 13:59:13 +02:00
parent b11b79ded0
commit 418eaa67f0
No known key found for this signature in database
4 changed files with 2 additions and 9 deletions

View File

@ -1,9 +1,6 @@
# vi: ft=sh # vi: ft=sh
# shellcheck disable=SC2034 # shellcheck disable=SC2034
# http route prefix (will listen to $KEIBI_PREFIX/users for example)
KEIBI_PREFIX=""
# path of the private key used to sign jwts. If this is empty, a new one will be generated on startup # path of the private key used to sign jwts. If this is empty, a new one will be generated on startup
RSA_PRIVATE_KEY_PATH="" RSA_PRIVATE_KEY_PATH=""

View File

@ -22,7 +22,6 @@ import (
) )
type Configuration struct { type Configuration struct {
Prefix string
JwtPrivateKey *rsa.PrivateKey JwtPrivateKey *rsa.PrivateKey
JwtPublicKey *rsa.PublicKey JwtPublicKey *rsa.PublicKey
JwtKid string JwtKid string
@ -47,7 +46,6 @@ func LoadConfiguration(db *dbc.Queries) (*Configuration, error) {
ret := DefaultConfig ret := DefaultConfig
ret.PublicUrl = os.Getenv("PUBLIC_URL") ret.PublicUrl = os.Getenv("PUBLIC_URL")
ret.Prefix = os.Getenv("KEIBI_PREFIX")
claims := os.Getenv("EXTRA_CLAIMS") claims := os.Getenv("EXTRA_CLAIMS")
if claims != "" { if claims != "" {

View File

@ -228,8 +228,8 @@ func main() {
} }
h.config = conf h.config = conf
g := e.Group(conf.Prefix) g := e.Group("/auth")
r := e.Group(conf.Prefix) r := e.Group("/auth")
r.Use(h.TokenToJwt) r.Use(h.TokenToJwt)
r.Use(echojwt.WithConfig(echojwt.Config{ r.Use(echojwt.WithConfig(echojwt.Config{
SigningMethod: "RS256", SigningMethod: "RS256",

View File

@ -66,8 +66,6 @@ services:
condition: service_healthy condition: service_healthy
env_file: env_file:
- ./.env - ./.env
environment:
- KEIBI_PREFIX=/auth
labels: labels:
- "traefik.enable=true" - "traefik.enable=true"
- "traefik.http.routers.auth.rule=PathPrefix(`/auth/`)" - "traefik.http.routers.auth.rule=PathPrefix(`/auth/`)"