-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathauthn_mappings.feature
More file actions
127 lines (113 loc) · 7.54 KB
/
authn_mappings.feature
File metadata and controls
127 lines (113 loc) · 7.54 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
@endpoint(authn-mappings) @endpoint(authn-mappings-v2)
Feature: AuthN Mappings
[The AuthN Mappings API](https://docs.datadoghq.com/account_management/aut
hn_mapping/?tab=example) is used to automatically map groups of users to
roles in Datadog using attributes sent from Identity Providers. Use these
endpoints to manage your AuthN Mappings.
Background:
Given a valid "apiKeyAuth" key in the system
And a valid "appKeyAuth" key in the system
And an instance of "AuthNMappings" API
@generated @skip @team:DataDog/delegated-auth-login
Scenario: Create an AuthN Mapping returns "Bad Request" response
Given new "CreateAuthNMapping" request
And body with value {"data": {"attributes": {"attribute_key": "member-of", "attribute_value": "Development"}, "relationships": {"role": {"data": {"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "type": "roles"}}}, "type": "authn_mappings"}}
When the request is sent
Then the response status is 400 Bad Request
@generated @skip @team:DataDog/delegated-auth-login
Scenario: Create an AuthN Mapping returns "Not Found" response
Given new "CreateAuthNMapping" request
And body with value {"data": {"attributes": {"attribute_key": "member-of", "attribute_value": "Development"}, "relationships": {"role": {"data": {"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "type": "roles"}}}, "type": "authn_mappings"}}
When the request is sent
Then the response status is 404 Not Found
@team:DataDog/delegated-auth-login
Scenario: Create an AuthN Mapping returns "OK" response
Given there is a valid "role" in the system
And new "CreateAuthNMapping" request
And body with value {"data": {"attributes": {"attribute_key": "{{ unique_lower_alnum }}", "attribute_value": "{{ unique }}"}, "relationships": {"role": {"data": {"id": "{{ role.data.id }}", "type": "roles"}}}, "type": "authn_mappings"}}
When the request is sent
Then the response status is 200 OK
And the response "data.attributes.attribute_key" is equal to "{{ unique_lower_alnum }}"
And the response "data.attributes.attribute_value" is equal to "{{ unique }}"
And the response "data.relationships.role.data.id" is equal to "{{ role.data.id }}"
@generated @skip @team:DataDog/delegated-auth-login
Scenario: Delete an AuthN Mapping returns "Not Found" response
Given new "DeleteAuthNMapping" request
And request contains "authn_mapping_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found
@team:DataDog/delegated-auth-login
Scenario: Delete an AuthN Mapping returns "OK" response
Given there is a valid "role" in the system
And there is a valid "authn_mapping" in the system
And new "DeleteAuthNMapping" request
And request contains "authn_mapping_id" parameter from "authn_mapping.data.id"
When the request is sent
Then the response status is 204 OK
@generated @skip @team:DataDog/delegated-auth-login
Scenario: Edit an AuthN Mapping returns "Bad Request" response
Given new "UpdateAuthNMapping" request
And request contains "authn_mapping_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"attribute_key": "member-of", "attribute_value": "Development"}, "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "relationships": {"role": {"data": {"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "type": "roles"}}}, "type": "authn_mappings"}}
When the request is sent
Then the response status is 400 Bad Request
@generated @skip @team:DataDog/delegated-auth-login
Scenario: Edit an AuthN Mapping returns "Conflict" response
Given new "UpdateAuthNMapping" request
And request contains "authn_mapping_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"attribute_key": "member-of", "attribute_value": "Development"}, "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "relationships": {"role": {"data": {"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "type": "roles"}}}, "type": "authn_mappings"}}
When the request is sent
Then the response status is 409 Conflict
@generated @skip @team:DataDog/delegated-auth-login
Scenario: Edit an AuthN Mapping returns "Not Found" response
Given new "UpdateAuthNMapping" request
And request contains "authn_mapping_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"attribute_key": "member-of", "attribute_value": "Development"}, "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "relationships": {"role": {"data": {"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "type": "roles"}}}, "type": "authn_mappings"}}
When the request is sent
Then the response status is 404 Not Found
@team:DataDog/delegated-auth-login
Scenario: Edit an AuthN Mapping returns "OK" response
Given there is a valid "role" in the system
And there is a valid "authn_mapping" in the system
And new "UpdateAuthNMapping" request
And request contains "authn_mapping_id" parameter from "authn_mapping.data.id"
And body with value {"data": {"attributes": {"attribute_key": "member-of", "attribute_value": "Development"}, "id": "{{ authn_mapping.data.id }}", "relationships": {"role": {"data": {"id": "{{ role.data.id }}", "type": "roles"}}}, "type": "authn_mappings"}}
When the request is sent
Then the response status is 200 OK
And the response "data.id" is equal to "{{ authn_mapping.data.id }}"
And the response "data.attributes.attribute_key" is equal to "member-of"
And the response "data.attributes.attribute_value" is equal to "Development"
And the response "data.relationships.role.data.id" is equal to "{{ role.data.id }}"
@generated @skip @team:DataDog/delegated-auth-login
Scenario: Edit an AuthN Mapping returns "Unprocessable Entity" response
Given new "UpdateAuthNMapping" request
And request contains "authn_mapping_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"attribute_key": "member-of", "attribute_value": "Development"}, "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "relationships": {"role": {"data": {"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "type": "roles"}}}, "type": "authn_mappings"}}
When the request is sent
Then the response status is 422 Unprocessable Entity
@generated @skip @team:DataDog/delegated-auth-login
Scenario: Get an AuthN Mapping by UUID returns "Not Found" response
Given new "GetAuthNMapping" request
And request contains "authn_mapping_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found
@team:DataDog/delegated-auth-login
Scenario: Get an AuthN Mapping by UUID returns "OK" response
Given there is a valid "role" in the system
And there is a valid "authn_mapping" in the system
And new "GetAuthNMapping" request
And request contains "authn_mapping_id" parameter from "authn_mapping.data.id"
When the request is sent
Then the response status is 200 OK
And the response "data.id" is equal to "{{ authn_mapping.data.id }}"
And the response "data.attributes.attribute_key" is equal to "{{ unique_lower_alnum }}"
And the response "data.attributes.attribute_value" is equal to "{{ unique }}"
And the response "data.relationships.role.data.id" is equal to "{{ role.data.id }}"
@team:DataDog/delegated-auth-login
Scenario: List all AuthN Mappings returns "OK" response
Given there is a valid "role" in the system
And there is a valid "authn_mapping" in the system
And new "ListAuthNMappings" request
When the request is sent
Then the response status is 200 OK
And the response "data[0].type" is equal to "authn_mappings"