mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:27:42 +00:00
fix: add organizationID query for user v2 ListUsers and clean up depeprecated attribute (#7593)
Add organizationID as query for ListUsers and clean up the deprecated Organisation attributes in other queries. This PR removes the following fields from API requests (user service v2): organisation from AddHumanUser (deprecated some time ago, organization still exists) organization from GetUserByID
This commit is contained in:
@@ -44,30 +44,17 @@ func authorize(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo,
|
||||
|
||||
func orgIDAndDomainFromRequest(ctx context.Context, req interface{}) (id, domain string) {
|
||||
orgID := grpc_util.GetHeader(ctx, http.ZitadelOrgID)
|
||||
o, ok := req.(OrganizationFromRequest)
|
||||
if !ok {
|
||||
return orgID, ""
|
||||
}
|
||||
id = o.OrganizationFromRequest().ID
|
||||
domain = o.OrganizationFromRequest().Domain
|
||||
if id != "" || domain != "" {
|
||||
return id, domain
|
||||
}
|
||||
// check if the deprecated organisation is used.
|
||||
// to be removed before going GA (https://github.com/zitadel/zitadel/issues/6718)
|
||||
id = o.OrganisationFromRequest().ID
|
||||
domain = o.OrganisationFromRequest().Domain
|
||||
if id != "" || domain != "" {
|
||||
return id, domain
|
||||
oz, ok := req.(OrganizationFromRequest)
|
||||
if ok {
|
||||
id = oz.OrganizationFromRequest().ID
|
||||
domain = oz.OrganizationFromRequest().Domain
|
||||
if id != "" || domain != "" {
|
||||
return id, domain
|
||||
}
|
||||
}
|
||||
return orgID, domain
|
||||
}
|
||||
|
||||
// Deprecated: will be removed in favor of OrganizationFromRequest (https://github.com/zitadel/zitadel/issues/6718)
|
||||
type OrganisationFromRequest interface {
|
||||
OrganisationFromRequest() *Organization
|
||||
}
|
||||
|
||||
type Organization struct {
|
||||
ID string
|
||||
Domain string
|
||||
@@ -75,5 +62,4 @@ type Organization struct {
|
||||
|
||||
type OrganizationFromRequest interface {
|
||||
OrganizationFromRequest() *Organization
|
||||
OrganisationFromRequest
|
||||
}
|
||||
|
Reference in New Issue
Block a user