github.com/kyma-project/kyma-environment-broker@v0.0.1/internal/ias/input.go (about)

     1  package ias
     2  
     3  import "fmt"
     4  
     5  type SPInputID int
     6  
     7  const ( // enum SPInputID
     8  	SPDexID     = 1
     9  	SPGrafanaID = 2
    10  )
    11  
    12  const ( // enum SsoType
    13  	OIDC = "openIdConnect"
    14  	SAML = "saml2"
    15  )
    16  
    17  type ServiceProviderParam struct {
    18  	domain        string
    19  	ssoType       string
    20  	redirectPath  string
    21  	allowedGroups []string
    22  }
    23  
    24  var ServiceProviderInputs = map[SPInputID]ServiceProviderParam{
    25  	SPGrafanaID: {
    26  		domain:        "grafana",
    27  		ssoType:       OIDC,
    28  		redirectPath:  "/login/generic_oauth",
    29  		allowedGroups: []string{"skr-monitoring-admin", "skr-monitoring-viewer"},
    30  	},
    31  }
    32  
    33  func (id SPInputID) isValid() error {
    34  	switch id {
    35  	case SPGrafanaID, SPDexID:
    36  		return nil
    37  	}
    38  	return fmt.Errorf("invalid Service Provider input ID: %d", id)
    39  }