Fix OpsProof operator authorization tests
This commit is contained in:
parent
2927b05f3f
commit
380ff65c43
|
|
@ -10,6 +10,7 @@ import (
|
|||
)
|
||||
|
||||
func TestDexLoginRequiresAnAllowedVerifiedOperator(t *testing.T) {
|
||||
t.Setenv("OPSPROOF_OPERATOR_EMAILS", "operator@example.test")
|
||||
client := tests.New(t, laraveltest.Env(map[string]string{
|
||||
"OPSPROOF_DEX_ISSUER": "https://auth.example.test",
|
||||
"OPSPROOF_DEX_CLIENT_SECRET": "test-secret",
|
||||
|
|
@ -29,6 +30,7 @@ func TestDexLoginRequiresAnAllowedVerifiedOperator(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestDexLoginRejectsAnUnlistedIdentity(t *testing.T) {
|
||||
t.Setenv("OPSPROOF_OPERATOR_EMAILS", "operator@example.test")
|
||||
client := tests.New(t, laraveltest.Env(map[string]string{
|
||||
"OPSPROOF_DEX_ISSUER": "https://auth.example.test",
|
||||
"OPSPROOF_DEX_CLIENT_SECRET": "test-secret",
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import (
|
|||
)
|
||||
|
||||
func TestIncidentPageRendersDeterministicDoctorEvidence(t *testing.T) {
|
||||
t.Setenv("OPSPROOF_OPERATOR_EMAILS", "operator@example.test")
|
||||
server := httptest.NewServer(http.HandlerFunc(func(response http.ResponseWriter, request *http.Request) {
|
||||
switch request.URL.Path {
|
||||
case "/v1/execute":
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import (
|
|||
)
|
||||
|
||||
func TestProposalApprovalRevalidatesAndSubmitsExactDoctorAction(t *testing.T) {
|
||||
t.Setenv("OPSPROOF_OPERATOR_EMAILS", "operator@example.test")
|
||||
doctorRequests := 0
|
||||
server := httptest.NewServer(http.HandlerFunc(func(response http.ResponseWriter, request *http.Request) {
|
||||
switch request.URL.Path {
|
||||
|
|
|
|||
|
|
@ -144,6 +144,11 @@ class OpsProofPipelineTests(unittest.TestCase):
|
|||
self.assertIn("operatorAllowed(email)", auth_handler)
|
||||
self.assertIn("auth.Login", auth_handler)
|
||||
|
||||
auth_test = (
|
||||
ROOT / "apps/opsproof/overlay/tests/feature/authentication_test.go"
|
||||
).read_text(encoding="utf-8")
|
||||
self.assertIn('t.Setenv("OPSPROOF_OPERATOR_EMAILS"', auth_test)
|
||||
|
||||
routes = (ROOT / "apps/opsproof/overlay/routes/web.go").read_text(
|
||||
encoding="utf-8"
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue