github.com/argoproj-labs/argocd-operator@v0.10.0/controllers/argocd/keycloak_types.go (about)

     1  package argocd
     2  
     3  type KeycloakAPIClient struct {
     4  	// Client ID.
     5  	// +kubebuilder:validation:Required
     6  	ClientID string `json:"clientId"`
     7  	// Client name.
     8  	// +optional
     9  	Name string `json:"name,omitempty"`
    10  	// What Client authentication type to use.
    11  	// +optional
    12  	ClientAuthenticatorType string `json:"clientAuthenticatorType,omitempty"`
    13  	// Client Secret. The Operator will automatically create a Secret based on this value.
    14  	// +optional
    15  	Secret string `json:"secret,omitempty"`
    16  	// Application base URL.
    17  	// +optional
    18  	BaseURL string `json:"baseUrl,omitempty"`
    19  	// Application Admin URL.
    20  	// +optional
    21  	AdminURL string `json:"adminUrl,omitempty"`
    22  	// Application root URL.
    23  	// +optional
    24  	RootURL string `json:"rootUrl,omitempty"`
    25  	// A list of valid Redirection URLs.
    26  	// +optional
    27  	RedirectUris []string `json:"redirectUris,omitempty"`
    28  	// A list of valid Web Origins.
    29  	// +optional
    30  	WebOrigins []string `json:"webOrigins,omitempty"`
    31  	// True if Standard flow is enabled.
    32  	// +optional
    33  	StandardFlowEnabled bool `json:"standardFlowEnabled"`
    34  	// A list of default client scopes. Default client scopes are
    35  	// always applied when issuing OpenID Connect tokens or SAML
    36  	// assertions for this client.
    37  	// +optional
    38  	DefaultClientScopes []string `json:"defaultClientScopes,omitempty"`
    39  }
    40  
    41  type KeycloakClientScope struct {
    42  	// +optional
    43  	Attributes map[string]string `json:"attributes,omitempty"`
    44  	// +optional
    45  	ID string `json:"id,omitempty"`
    46  	// +optional
    47  	Name string `json:"name,omitempty"`
    48  	// +optional
    49  	Protocol string `json:"protocol,omitempty"`
    50  	// Protocol Mappers.
    51  	// +optional
    52  	ProtocolMappers []KeycloakProtocolMapper `json:"protocolMappers,omitempty"`
    53  }
    54  
    55  type KeycloakProtocolMapper struct {
    56  	// Protocol Mapper ID.
    57  	// +optional
    58  	ID string `json:"id,omitempty"`
    59  	// Protocol Mapper Name.
    60  	// +optional
    61  	Name string `json:"name,omitempty"`
    62  	// Protocol to use.
    63  	// +optional
    64  	Protocol string `json:"protocol,omitempty"`
    65  	// Protocol Mapper to use
    66  	// +optional
    67  	ProtocolMapper string `json:"protocolMapper,omitempty"`
    68  	// Config options.
    69  	// +optional
    70  	Config map[string]string `json:"config,omitempty"`
    71  }
    72  
    73  type KeycloakIdentityProvider struct {
    74  	// Identity Provider Alias.
    75  	// +optional
    76  	Alias string `json:"alias,omitempty"`
    77  	// Identity Provider Display Name.
    78  	// +optional
    79  	DisplayName string `json:"displayName,omitempty"`
    80  	// Identity Provider ID.
    81  	// +optional
    82  	ProviderID string `json:"providerId,omitempty"`
    83  	// Identity Provider config.
    84  	// +optional
    85  	Config map[string]string `json:"config,omitempty"`
    86  }
    87  
    88  type TokenResponse struct {
    89  	// Token Response Access Token.
    90  	// +optional
    91  	AccessToken string `json:"access_token"`
    92  	// Token Response Error.
    93  	// +optional
    94  	Error string `json:"error"`
    95  }
    96  
    97  // KeycloakPostData defines the values required to update Keycloak Realm.
    98  type keycloakConfig struct {
    99  	ArgoName           string
   100  	ArgoNamespace      string
   101  	Username           string
   102  	Password           string
   103  	KeycloakURL        string
   104  	ArgoCDURL          string
   105  	KeycloakServerCert []byte
   106  	VerifyTLS          bool
   107  }
   108  
   109  type oidcConfig struct {
   110  	Name           string   `json:"name"`
   111  	Issuer         string   `json:"issuer"`
   112  	ClientID       string   `json:"clientID"`
   113  	ClientSecret   string   `json:"clientSecret"`
   114  	RequestedScope []string `json:"requestedScopes"`
   115  	RootCA         string   `json:"rootCA,omitempty"`
   116  }
   117  
   118  // KeycloakIdentityProviderMapper defines IdentityProvider Mappers
   119  // issue: https://github.com/keycloak/keycloak-operator/issues/471
   120  type KeycloakIdentityProviderMapper struct {
   121  	// Name
   122  	// +optional
   123  	Name string `json:"name,omitempty"`
   124  	// Identity Provider Alias.
   125  	// +optional
   126  	IdentityProviderAlias string `json:"identityProviderAlias,omitempty"`
   127  	// Identity Provider Mapper.
   128  	// +optional
   129  	IdentityProviderMapper string `json:"identityProviderMapper,omitempty"`
   130  	// Identity Provider Mapper config.
   131  	// +optional
   132  	Config map[string]string `json:"config,omitempty"`
   133  }
   134  
   135  // CustomKeycloakAPIRealm is an extention type of KeycloakAPIRealm as is it does not
   136  // support IdentityProvider Mappers
   137  // issue: https://github.com/keycloak/keycloak-operator/issues/471
   138  type CustomKeycloakAPIRealm struct {
   139  	// Realm name.
   140  	Realm string `json:"realm"`
   141  	// Realm enabled flag.
   142  	// +optional
   143  	Enabled bool `json:"enabled"`
   144  	// Require SSL
   145  	// +optional
   146  	SslRequired string `json:"sslRequired,omitempty"`
   147  	// A set of Keycloak Clients.
   148  	// +optional
   149  	Clients []*KeycloakAPIClient `json:"clients,omitempty"`
   150  	// Client scopes
   151  	// +optional
   152  	ClientScopes []KeycloakClientScope `json:"clientScopes,omitempty"`
   153  	// A set of Identity Providers.
   154  	// +optional
   155  	IdentityProviders []*KeycloakIdentityProvider `json:"identityProviders,omitempty"`
   156  	// KeycloakIdentityProviderMapper defines IdentityProvider Mappers
   157  	// issue: https://github.com/keycloak/keycloak-operator/issues/471
   158  	IdentityProviderMappers []*KeycloakIdentityProviderMapper `json:"identityProviderMappers,omitempty"`
   159  }