-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauth_flow.textproto
More file actions
93 lines (82 loc) · 1.91 KB
/
Copy pathauth_flow.textproto
File metadata and controls
93 lines (82 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Authentication flow test manifest
#
# Tests ExtProc authentication scenarios including:
# - Valid authentication passing through
# - Invalid authentication being rejected with immediate response
name: "auth-flow"
description: "Test authentication handling in ExtProc"
test_cases: {
name: "valid-auth-passthrough"
description: "Valid authentication should pass through with additional headers"
tags: ["auth", "smoke"]
request: {
method: "GET"
path: "/api/v1/protected"
scheme: "https"
authority: "api.example.com"
headers: {
key: "authorization"
value: "Bearer valid-token-123"
}
}
expectations: {
phase: REQUEST_HEADERS
headers_response: {
set_headers: {
key: "x-user-id"
value: "user-123"
}
set_headers: {
key: "x-auth-validated"
value: "true"
}
}
}
}
test_cases: {
name: "invalid-auth-rejection"
description: "Invalid authentication should return 401 immediate response"
tags: ["auth", "error"]
request: {
method: "GET"
path: "/api/v1/protected"
scheme: "https"
authority: "api.example.com"
headers: {
key: "authorization"
value: "Bearer invalid-token"
}
}
expectations: {
phase: REQUEST_HEADERS
immediate_response: {
status_code: 401
headers: {
key: "content-type"
value: "application/json"
}
body: '{"error": "unauthorized", "message": "Invalid token"}'
}
}
}
test_cases: {
name: "missing-auth-rejection"
description: "Missing authentication should return 401 immediate response"
tags: ["auth", "error"]
request: {
method: "GET"
path: "/api/v1/protected"
scheme: "https"
authority: "api.example.com"
}
expectations: {
phase: REQUEST_HEADERS
immediate_response: {
status_code: 401
headers: {
key: "www-authenticate"
value: "Bearer"
}
}
}
}