The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
grafana/pkg/services/authn/grpcutils/config.go

36 lines
952 B

package grpcutils
import (
"github.com/grafana/grafana/pkg/setting"
)
type GrpcClientConfig struct {
Token string
TokenExchangeURL string
TokenNamespace string
}
1 year ago
func ReadGrpcClientConfig(cfg *setting.Cfg) *GrpcClientConfig {
section := cfg.SectionWithEnvOverrides("grpc_client_authentication")
return &GrpcClientConfig{
Token: section.Key("token").MustString(""),
TokenExchangeURL: section.Key("token_exchange_url").MustString(""),
TokenNamespace: section.Key("token_namespace").MustString("stack-" + cfg.StackID),
}
}
1 year ago
type GrpcServerConfig struct {
SigningKeysURL string
AllowedAudiences []string
}
func ReadGprcServerConfig(cfg *setting.Cfg) *GrpcServerConfig {
1 year ago
section := cfg.SectionWithEnvOverrides("grpc_server_authentication")
return &GrpcServerConfig{
SigningKeysURL: section.Key("signing_keys_url").MustString(""),
AllowedAudiences: section.Key("allowed_audiences").Strings(","),
}
1 year ago
}