feat(actions): add org metadata in complement token and saml response flows (#7263)

* feat(actions): add org metadata in complement token and saml response flows

* document actions
This commit is contained in:
Livio Spring
2024-01-26 09:56:10 +01:00
committed by GitHub
parent 17953e9040
commit 121f9f8da1
6 changed files with 116 additions and 0 deletions

View File

@@ -249,6 +249,24 @@ func (p *Storage) getCustomAttributes(ctx context.Context, user *query.User, use
return object.UserGrantsFromQuery(c, userGrants)
}),
),
actions.SetFields("org",
actions.SetFields("getMetadata", func(c *actions.FieldConfig) interface{} {
return func(goja.FunctionCall) goja.Value {
metadata, err := p.query.SearchOrgMetadata(
ctx,
true,
user.ResourceOwner,
&query.OrgMetadataSearchQueries{},
false,
)
if err != nil {
logging.WithError(err).Info("unable to get org metadata in action")
panic(err)
}
return object.OrgMetadataListFromQuery(c, metadata)
}
}),
),
),
)