IDForwarding: Add auth hook to generate id token (#75555)

* AuthN: Move identity struct to its own file

* IDForwarding: Add IDToken property to usr and identity structs and add GetIDToken to requester interface

* Inject IDService into background services

* IDForwarding: Register post auth hook when feature toggle is enabled
This commit is contained in:
Karl Persson
2023-09-28 09:22:05 +02:00
committed by GitHub
parent 3a1c3be057
commit b9b4246432
8 changed files with 264 additions and 170 deletions
+7
View File
@@ -27,6 +27,9 @@ type SignedInUser struct {
Teams []int64
// Permissions grouped by orgID and actions
Permissions map[int64]map[string][]string `json:"-"`
// IDToken is a signed token representing the identity that can be forwarded to plugins and external services.
// Will only be set when featuremgmt.FlagIdForwarding is enabled.
IDToken string `json:"-" xorm:"-"`
}
func (u *SignedInUser) ShouldUpdateLastSeenAt() bool {
@@ -210,3 +213,7 @@ func (u *SignedInUser) GetDisplayName() string {
func (u *SignedInUser) GetAuthenticatedBy() string {
return u.AuthenticatedBy
}
func (u *SignedInUser) GetIDToken() string {
return u.IDToken
}