123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- package legacy
- type BaseConfig struct {
-
-
-
-
- AuthenticationMethod string `ini:"authentication_method" json:"authentication_method"`
-
-
- AuthenticateHeartBeats bool `ini:"authenticate_heartbeats" json:"authenticate_heartbeats"`
-
-
- AuthenticateNewWorkConns bool `ini:"authenticate_new_work_conns" json:"authenticate_new_work_conns"`
- }
- func getDefaultBaseConf() BaseConfig {
- return BaseConfig{
- AuthenticationMethod: "token",
- AuthenticateHeartBeats: false,
- AuthenticateNewWorkConns: false,
- }
- }
- type ClientConfig struct {
- BaseConfig `ini:",extends"`
- OidcClientConfig `ini:",extends"`
- TokenConfig `ini:",extends"`
- }
- func GetDefaultClientConf() ClientConfig {
- return ClientConfig{
- BaseConfig: getDefaultBaseConf(),
- OidcClientConfig: getDefaultOidcClientConf(),
- TokenConfig: getDefaultTokenConf(),
- }
- }
- type ServerConfig struct {
- BaseConfig `ini:",extends"`
- OidcServerConfig `ini:",extends"`
- TokenConfig `ini:",extends"`
- }
- func GetDefaultServerConf() ServerConfig {
- return ServerConfig{
- BaseConfig: getDefaultBaseConf(),
- OidcServerConfig: getDefaultOidcServerConf(),
- TokenConfig: getDefaultTokenConf(),
- }
- }
- type OidcClientConfig struct {
-
-
-
- OidcClientID string `ini:"oidc_client_id" json:"oidc_client_id"`
-
-
-
- OidcClientSecret string `ini:"oidc_client_secret" json:"oidc_client_secret"`
-
-
- OidcAudience string `ini:"oidc_audience" json:"oidc_audience"`
-
-
- OidcScope string `ini:"oidc_scope" json:"oidc_scope"`
-
-
-
- OidcTokenEndpointURL string `ini:"oidc_token_endpoint_url" json:"oidc_token_endpoint_url"`
-
-
-
- OidcAdditionalEndpointParams map[string]string `ini:"-" json:"oidc_additional_endpoint_params"`
- }
- func getDefaultOidcClientConf() OidcClientConfig {
- return OidcClientConfig{
- OidcClientID: "",
- OidcClientSecret: "",
- OidcAudience: "",
- OidcScope: "",
- OidcTokenEndpointURL: "",
- OidcAdditionalEndpointParams: make(map[string]string),
- }
- }
- type OidcServerConfig struct {
-
-
-
-
- OidcIssuer string `ini:"oidc_issuer" json:"oidc_issuer"`
-
-
-
-
- OidcAudience string `ini:"oidc_audience" json:"oidc_audience"`
-
-
-
- OidcSkipExpiryCheck bool `ini:"oidc_skip_expiry_check" json:"oidc_skip_expiry_check"`
-
-
-
- OidcSkipIssuerCheck bool `ini:"oidc_skip_issuer_check" json:"oidc_skip_issuer_check"`
- }
- func getDefaultOidcServerConf() OidcServerConfig {
- return OidcServerConfig{
- OidcIssuer: "",
- OidcAudience: "",
- OidcSkipExpiryCheck: false,
- OidcSkipIssuerCheck: false,
- }
- }
- type TokenConfig struct {
-
-
-
- Token string `ini:"token" json:"token"`
- }
- func getDefaultTokenConf() TokenConfig {
- return TokenConfig{
- Token: "",
- }
- }
|