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:
parent
56d085bd08
commit
098ab0357c
2 changed files with 38 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue