mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 02:54:20 +00:00
fix: internal api health check (#3083)
This commit is contained in:
parent
2592383a7c
commit
3ee3b8f6d3
@ -46,7 +46,7 @@ type API struct {
|
||||
|
||||
type health interface {
|
||||
Health(ctx context.Context) error
|
||||
IamByID(ctx context.Context) (*iam_model.IAM, error)
|
||||
IAMByID(ctx context.Context, id string) (*iam_model.IAM, error)
|
||||
VerifierClientID(ctx context.Context, appName string) (string, string, error)
|
||||
}
|
||||
|
||||
@ -73,6 +73,7 @@ func Create(config Config, authZ authz.Config, q *query.Queries, authZRepo *auth
|
||||
}
|
||||
|
||||
api.verifier = authz.Start(&repo)
|
||||
api.health = &repo
|
||||
api.auth = authRepo
|
||||
api.admin = adminRepo
|
||||
api.grpcServer = server.CreateServer(api.verifier, authZ, sd.DefaultLanguage)
|
||||
@ -107,7 +108,7 @@ func (a *API) healthHandler() http.Handler {
|
||||
return nil
|
||||
},
|
||||
func(ctx context.Context) error {
|
||||
iam, err := a.health.IamByID(ctx)
|
||||
iam, err := a.health.IAMByID(ctx, domain.IAMID)
|
||||
if err != nil && !errors.IsNotFound(err) {
|
||||
return errors.ThrowPreconditionFailed(err, "API-dsgT2", "IAM SETUP CHECK FAILED")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user