add casbin user test (#2474)

* add casbin user test

Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>

* Delete double slash

* types/users: use join url on iss that are ursl

Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>

---------

Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
Co-authored-by: Juan Font <juanfontalonso@gmail.com>
This commit is contained in:
Kristoffer Dalby 2025-04-23 13:21:51 +02:00 committed by GitHub
parent 56d085bd08
commit 098ab0357c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 38 additions and 1 deletions

View file

@ -6,6 +6,7 @@ import (
"encoding/json"
"fmt"
"net/mail"
"net/url"
"strconv"
"strings"
@ -194,6 +195,11 @@ type OIDCClaims struct {
}
func (c *OIDCClaims) Identifier() string {
if strings.HasPrefix(c.Iss, "http") {
if i, err := url.JoinPath(c.Iss, c.Sub); err == nil {
return i
}
}
return c.Iss + "/" + c.Sub
}