| 1 |
import uuid |
| 2 |
|
| 3 |
from globus_sdk.testing.models import RegisteredResponse, ResponseSet |
| 4 |
|
| 5 |
GREEN_LIGHT_POLICY = { |
| 6 |
"high_assurance": False, |
| 7 |
"domain_constraints_include": ["greenlight.org"], |
| 8 |
"display_name": "GreenLight domain Only Policy", |
| 9 |
"description": "Only allow access from @greenlight.org", |
| 10 |
"id": str(uuid.uuid1()), |
| 11 |
"domain_constraints_exclude": None, |
| 12 |
"project_id": "da84e531-1afb-43cb-8c87-135ab580516a", |
| 13 |
"authentication_assurance_timeout": 35, |
| 14 |
"required_mfa": False, |
| 15 |
} |
| 16 |
|
| 17 |
RED_LIGHT_POLICY = { |
| 18 |
"high_assurance": True, |
| 19 |
"domain_constraints_include": None, |
| 20 |
"display_name": "No RedLight domain Policy", |
| 21 |
"description": "Disallow access from @redlight.org", |
| 22 |
"id": str(uuid.uuid1()), |
| 23 |
"domain_constraints_exclude": ["redlight.org"], |
| 24 |
"project_id": "da84e531-1afb-43cb-8c87-135ab580516a", |
| 25 |
"authentication_assurance_timeout": 35, |
| 26 |
"required_mfa": False, |
| 27 |
} |
| 28 |
|
| 29 |
RESPONSES = ResponseSet( |
| 30 |
default=RegisteredResponse( |
| 31 |
service="auth", |
| 32 |
path="/v2/api/policies", |
| 33 |
json={"policies": [GREEN_LIGHT_POLICY, RED_LIGHT_POLICY]}, |
| 34 |
metadata={ |
| 35 |
"policy_ids": [GREEN_LIGHT_POLICY["id"], RED_LIGHT_POLICY["id"]], |
| 36 |
}, |
| 37 |
) |
| 38 |
) |