Skip to content

Commit

Permalink
add all supported kyc instances
Browse files Browse the repository at this point in the history
  • Loading branch information
Eslam-Nawara committed Oct 30, 2024
1 parent 591810a commit bb430a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
8 changes: 4 additions & 4 deletions pkg/environment/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ var (
"https://graphql.dev.grid.tf/graphql",
"https://graphql.02.dev.grid.tf/graphql",
},
KycURL: "",
KycURL: "https://kyc.dev.grid.tf",
}

envTest = Environment{
Expand All @@ -148,7 +148,7 @@ var (
"https://graphql.test.grid.tf/graphql",
"https://graphql.02.test.grid.tf/graphql",
},
KycURL: "",
KycURL: "https://kyc.test.grid.tf",
}

envQA = Environment{
Expand All @@ -171,7 +171,7 @@ var (
"https://graphql.qa.grid.tf/graphql",
"https://graphql.02.qa.grid.tf/graphql",
},
KycURL: "",
KycURL: "https://kyc.qa.grid.tf",
}

envProd = Environment{
Expand All @@ -197,7 +197,7 @@ var (
"https://graphql.grid.tf/graphql",
"https://graphql.02.grid.tf/graphql",
},
KycURL: "https://kyc1.gent01.dev.grid.tf",
KycURL: "https://kyc.grid.tf",
}
)

Expand Down
10 changes: 3 additions & 7 deletions pkg/provision/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ func (n *NativeEngine) CreateOrUpdate(twin uint32, deployment gridtypes.Deployme
}

// make sure the account used is verified
if getTwinVerificationState(twin) != "VERIFIED" {
if getTwinVerificationStatus(twin) != "VERIFIED" {
return fmt.Errorf("user is not verified")
}

Expand Down Expand Up @@ -1182,8 +1182,8 @@ func (e *NativeEngine) GetWorkloadStatus(id string) (gridtypes.ResultState, bool
return wl.Result.State, true, nil
}

// getTwinVerificationState make sure the account used is verified we have the user public key in bytes(pkBytes)
func getTwinVerificationState(twinID uint32) (status string) {
// getTwinVerificationStatus make sure the account used is verified we have the user public key in bytes(pkBytes)
func getTwinVerificationStatus(twinID uint32) (status string) {
status = "FAILED"
env := environment.MustGet()

Expand All @@ -1192,10 +1192,6 @@ func getTwinVerificationState(twinID uint32) (status string) {
return
}

if len(verificationServiceURL) == 0 {
return "VERIFIED"
}

request, err := http.NewRequest(http.MethodGet, verificationServiceURL, nil)
if err != nil {
return
Expand Down

0 comments on commit bb430a7

Please sign in to comment.