mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-16 07:16:38 +00:00
[management] Allow updating embedded IdP user name and email (#5721)
This commit is contained in:
@@ -780,9 +780,15 @@ func (am *DefaultAccountManager) processUserUpdate(ctx context.Context, transact
|
|||||||
updatedUser.Role = update.Role
|
updatedUser.Role = update.Role
|
||||||
updatedUser.Blocked = update.Blocked
|
updatedUser.Blocked = update.Blocked
|
||||||
updatedUser.AutoGroups = update.AutoGroups
|
updatedUser.AutoGroups = update.AutoGroups
|
||||||
// these two fields can't be set via API, only via direct call to the method
|
// these fields can't be set via API, only via direct call to the method
|
||||||
updatedUser.Issued = update.Issued
|
updatedUser.Issued = update.Issued
|
||||||
updatedUser.IntegrationReference = update.IntegrationReference
|
updatedUser.IntegrationReference = update.IntegrationReference
|
||||||
|
if update.Name != "" {
|
||||||
|
updatedUser.Name = update.Name
|
||||||
|
}
|
||||||
|
if update.Email != "" {
|
||||||
|
updatedUser.Email = update.Email
|
||||||
|
}
|
||||||
|
|
||||||
var transferredOwnerRole bool
|
var transferredOwnerRole bool
|
||||||
result, err := handleOwnerRoleTransfer(ctx, transaction, initiatorUser, update)
|
result, err := handleOwnerRoleTransfer(ctx, transaction, initiatorUser, update)
|
||||||
|
|||||||
@@ -4414,6 +4414,9 @@ components:
|
|||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
example: [ "Users" ]
|
example: [ "Users" ]
|
||||||
|
connector_id:
|
||||||
|
type: string
|
||||||
|
description: DEX connector ID for embedded IDP setups
|
||||||
IntegrationEnabled:
|
IntegrationEnabled:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
|
|||||||
@@ -1492,6 +1492,9 @@ type AzureIntegration struct {
|
|||||||
// ClientId Azure AD application (client) ID
|
// ClientId Azure AD application (client) ID
|
||||||
ClientId string `json:"client_id"`
|
ClientId string `json:"client_id"`
|
||||||
|
|
||||||
|
// ConnectorId DEX connector ID for embedded IDP setups
|
||||||
|
ConnectorId *string `json:"connector_id,omitempty"`
|
||||||
|
|
||||||
// Enabled Whether the integration is enabled
|
// Enabled Whether the integration is enabled
|
||||||
Enabled bool `json:"enabled"`
|
Enabled bool `json:"enabled"`
|
||||||
|
|
||||||
@@ -1632,6 +1635,9 @@ type CreateAzureIntegrationRequest struct {
|
|||||||
// ClientSecret Base64-encoded Azure AD client secret
|
// ClientSecret Base64-encoded Azure AD client secret
|
||||||
ClientSecret string `json:"client_secret"`
|
ClientSecret string `json:"client_secret"`
|
||||||
|
|
||||||
|
// ConnectorId DEX connector ID for embedded IDP setups
|
||||||
|
ConnectorId *string `json:"connector_id,omitempty"`
|
||||||
|
|
||||||
// GroupPrefixes List of start_with string patterns for groups to sync
|
// GroupPrefixes List of start_with string patterns for groups to sync
|
||||||
GroupPrefixes *[]string `json:"group_prefixes,omitempty"`
|
GroupPrefixes *[]string `json:"group_prefixes,omitempty"`
|
||||||
|
|
||||||
@@ -1653,6 +1659,9 @@ type CreateAzureIntegrationRequestHost string
|
|||||||
|
|
||||||
// CreateGoogleIntegrationRequest defines model for CreateGoogleIntegrationRequest.
|
// CreateGoogleIntegrationRequest defines model for CreateGoogleIntegrationRequest.
|
||||||
type CreateGoogleIntegrationRequest struct {
|
type CreateGoogleIntegrationRequest struct {
|
||||||
|
// ConnectorId DEX connector ID for embedded IDP setups
|
||||||
|
ConnectorId *string `json:"connector_id,omitempty"`
|
||||||
|
|
||||||
// CustomerId Customer ID from Google Workspace Account Settings
|
// CustomerId Customer ID from Google Workspace Account Settings
|
||||||
CustomerId string `json:"customer_id"`
|
CustomerId string `json:"customer_id"`
|
||||||
|
|
||||||
@@ -1689,6 +1698,9 @@ type CreateOktaScimIntegrationRequest struct {
|
|||||||
// ConnectionName The Okta enterprise connection name on Auth0
|
// ConnectionName The Okta enterprise connection name on Auth0
|
||||||
ConnectionName string `json:"connection_name"`
|
ConnectionName string `json:"connection_name"`
|
||||||
|
|
||||||
|
// ConnectorId DEX connector ID for embedded IDP setups
|
||||||
|
ConnectorId *string `json:"connector_id,omitempty"`
|
||||||
|
|
||||||
// GroupPrefixes List of start_with string patterns for groups to sync
|
// GroupPrefixes List of start_with string patterns for groups to sync
|
||||||
GroupPrefixes *[]string `json:"group_prefixes,omitempty"`
|
GroupPrefixes *[]string `json:"group_prefixes,omitempty"`
|
||||||
|
|
||||||
@@ -1698,6 +1710,9 @@ type CreateOktaScimIntegrationRequest struct {
|
|||||||
|
|
||||||
// CreateScimIntegrationRequest defines model for CreateScimIntegrationRequest.
|
// CreateScimIntegrationRequest defines model for CreateScimIntegrationRequest.
|
||||||
type CreateScimIntegrationRequest struct {
|
type CreateScimIntegrationRequest struct {
|
||||||
|
// ConnectorId DEX connector ID for embedded IDP setups
|
||||||
|
ConnectorId *string `json:"connector_id,omitempty"`
|
||||||
|
|
||||||
// GroupPrefixes List of start_with string patterns for groups to sync
|
// GroupPrefixes List of start_with string patterns for groups to sync
|
||||||
GroupPrefixes *[]string `json:"group_prefixes,omitempty"`
|
GroupPrefixes *[]string `json:"group_prefixes,omitempty"`
|
||||||
|
|
||||||
@@ -2154,6 +2169,9 @@ type GetTenantsResponse = []TenantResponse
|
|||||||
|
|
||||||
// GoogleIntegration defines model for GoogleIntegration.
|
// GoogleIntegration defines model for GoogleIntegration.
|
||||||
type GoogleIntegration struct {
|
type GoogleIntegration struct {
|
||||||
|
// ConnectorId DEX connector ID for embedded IDP setups
|
||||||
|
ConnectorId *string `json:"connector_id,omitempty"`
|
||||||
|
|
||||||
// CustomerId Customer ID from Google Workspace
|
// CustomerId Customer ID from Google Workspace
|
||||||
CustomerId string `json:"customer_id"`
|
CustomerId string `json:"customer_id"`
|
||||||
|
|
||||||
@@ -2502,6 +2520,9 @@ type IntegrationResponsePlatform string
|
|||||||
|
|
||||||
// IntegrationSyncFilters defines model for IntegrationSyncFilters.
|
// IntegrationSyncFilters defines model for IntegrationSyncFilters.
|
||||||
type IntegrationSyncFilters struct {
|
type IntegrationSyncFilters struct {
|
||||||
|
// ConnectorId DEX connector ID for embedded IDP setups
|
||||||
|
ConnectorId *string `json:"connector_id,omitempty"`
|
||||||
|
|
||||||
// GroupPrefixes List of start_with string patterns for groups to sync
|
// GroupPrefixes List of start_with string patterns for groups to sync
|
||||||
GroupPrefixes *[]string `json:"group_prefixes,omitempty"`
|
GroupPrefixes *[]string `json:"group_prefixes,omitempty"`
|
||||||
|
|
||||||
@@ -2994,6 +3015,9 @@ type OktaScimIntegration struct {
|
|||||||
// AuthToken SCIM API token (full on creation/regeneration, masked on retrieval)
|
// AuthToken SCIM API token (full on creation/regeneration, masked on retrieval)
|
||||||
AuthToken string `json:"auth_token"`
|
AuthToken string `json:"auth_token"`
|
||||||
|
|
||||||
|
// ConnectorId DEX connector ID for embedded IDP setups
|
||||||
|
ConnectorId *string `json:"connector_id,omitempty"`
|
||||||
|
|
||||||
// Enabled Whether the integration is enabled
|
// Enabled Whether the integration is enabled
|
||||||
Enabled bool `json:"enabled"`
|
Enabled bool `json:"enabled"`
|
||||||
|
|
||||||
@@ -3864,6 +3888,9 @@ type ScimIntegration struct {
|
|||||||
// AuthToken SCIM API token (full on creation, masked otherwise)
|
// AuthToken SCIM API token (full on creation, masked otherwise)
|
||||||
AuthToken string `json:"auth_token"`
|
AuthToken string `json:"auth_token"`
|
||||||
|
|
||||||
|
// ConnectorId DEX connector ID for embedded IDP setups
|
||||||
|
ConnectorId *string `json:"connector_id,omitempty"`
|
||||||
|
|
||||||
// Enabled Whether the integration is enabled
|
// Enabled Whether the integration is enabled
|
||||||
Enabled bool `json:"enabled"`
|
Enabled bool `json:"enabled"`
|
||||||
|
|
||||||
@@ -4341,6 +4368,9 @@ type UpdateAzureIntegrationRequest struct {
|
|||||||
// ClientSecret Base64-encoded Azure AD client secret
|
// ClientSecret Base64-encoded Azure AD client secret
|
||||||
ClientSecret *string `json:"client_secret,omitempty"`
|
ClientSecret *string `json:"client_secret,omitempty"`
|
||||||
|
|
||||||
|
// ConnectorId DEX connector ID for embedded IDP setups
|
||||||
|
ConnectorId *string `json:"connector_id,omitempty"`
|
||||||
|
|
||||||
// Enabled Whether the integration is enabled
|
// Enabled Whether the integration is enabled
|
||||||
Enabled *bool `json:"enabled,omitempty"`
|
Enabled *bool `json:"enabled,omitempty"`
|
||||||
|
|
||||||
@@ -4359,6 +4389,9 @@ type UpdateAzureIntegrationRequest struct {
|
|||||||
|
|
||||||
// UpdateGoogleIntegrationRequest defines model for UpdateGoogleIntegrationRequest.
|
// UpdateGoogleIntegrationRequest defines model for UpdateGoogleIntegrationRequest.
|
||||||
type UpdateGoogleIntegrationRequest struct {
|
type UpdateGoogleIntegrationRequest struct {
|
||||||
|
// ConnectorId DEX connector ID for embedded IDP setups
|
||||||
|
ConnectorId *string `json:"connector_id,omitempty"`
|
||||||
|
|
||||||
// CustomerId Customer ID from Google Workspace Account Settings
|
// CustomerId Customer ID from Google Workspace Account Settings
|
||||||
CustomerId *string `json:"customer_id,omitempty"`
|
CustomerId *string `json:"customer_id,omitempty"`
|
||||||
|
|
||||||
@@ -4380,6 +4413,9 @@ type UpdateGoogleIntegrationRequest struct {
|
|||||||
|
|
||||||
// UpdateOktaScimIntegrationRequest defines model for UpdateOktaScimIntegrationRequest.
|
// UpdateOktaScimIntegrationRequest defines model for UpdateOktaScimIntegrationRequest.
|
||||||
type UpdateOktaScimIntegrationRequest struct {
|
type UpdateOktaScimIntegrationRequest struct {
|
||||||
|
// ConnectorId DEX connector ID for embedded IDP setups
|
||||||
|
ConnectorId *string `json:"connector_id,omitempty"`
|
||||||
|
|
||||||
// Enabled Whether the integration is enabled
|
// Enabled Whether the integration is enabled
|
||||||
Enabled *bool `json:"enabled,omitempty"`
|
Enabled *bool `json:"enabled,omitempty"`
|
||||||
|
|
||||||
@@ -4392,6 +4428,9 @@ type UpdateOktaScimIntegrationRequest struct {
|
|||||||
|
|
||||||
// UpdateScimIntegrationRequest defines model for UpdateScimIntegrationRequest.
|
// UpdateScimIntegrationRequest defines model for UpdateScimIntegrationRequest.
|
||||||
type UpdateScimIntegrationRequest struct {
|
type UpdateScimIntegrationRequest struct {
|
||||||
|
// ConnectorId DEX connector ID for embedded IDP setups
|
||||||
|
ConnectorId *string `json:"connector_id,omitempty"`
|
||||||
|
|
||||||
// Enabled Whether the integration is enabled
|
// Enabled Whether the integration is enabled
|
||||||
Enabled *bool `json:"enabled,omitempty"`
|
Enabled *bool `json:"enabled,omitempty"`
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user