MCPcopy Create free account
hub / github.com/bytebase/bytebase / getConfigBytes

Function getConfigBytes

backend/store/idp.go:26–38  ·  view source on GitHub ↗
(config *storepb.IdentityProviderConfig)

Source from the content-addressed store, hash-verified

24}
25
26func getConfigBytes(config *storepb.IdentityProviderConfig) ([]byte, error) {
27 if v := config.GetOauth2Config(); v != nil {
28 configBytes, err := protojson.Marshal(v)
29 return configBytes, err
30 } else if v := config.GetOidcConfig(); v != nil {
31 configBytes, err := protojson.Marshal(v)
32 return configBytes, err
33 } else if v := config.GetLdapConfig(); v != nil {
34 configBytes, err := protojson.Marshal(v)
35 return configBytes, err
36 }
37 return nil, errors.Errorf("unexpected provider type")
38}
39
40// FindIdentityProviderMessage is the message for finding identity providers.
41type FindIdentityProviderMessage struct {

Callers 2

Calls 4

ErrorfMethod · 0.80
GetOauth2ConfigMethod · 0.45
GetOidcConfigMethod · 0.45
GetLdapConfigMethod · 0.45

Tested by

no test coverage detected