mirror of
https://github.com/zitadel/zitadel.git
synced 2025-03-04 03:05:13 +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 {
|
type health interface {
|
||||||
Health(ctx context.Context) error
|
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)
|
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.verifier = authz.Start(&repo)
|
||||||
|
api.health = &repo
|
||||||
api.auth = authRepo
|
api.auth = authRepo
|
||||||
api.admin = adminRepo
|
api.admin = adminRepo
|
||||||
api.grpcServer = server.CreateServer(api.verifier, authZ, sd.DefaultLanguage)
|
api.grpcServer = server.CreateServer(api.verifier, authZ, sd.DefaultLanguage)
|
||||||
@ -107,7 +108,7 @@ func (a *API) healthHandler() http.Handler {
|
|||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
func(ctx context.Context) error {
|
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) {
|
if err != nil && !errors.IsNotFound(err) {
|
||||||
return errors.ThrowPreconditionFailed(err, "API-dsgT2", "IAM SETUP CHECK FAILED")
|
return errors.ThrowPreconditionFailed(err, "API-dsgT2", "IAM SETUP CHECK FAILED")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user