Skip to content

Commit 3cca974

Browse files
Merge pull request #313 from ezilber-akamai/TPT-1811
Included `status` property in account login response
2 parents 0a77553 + 73c3741 commit 3cca974

File tree

3 files changed

+130
-232
lines changed

3 files changed

+130
-232
lines changed

account_logins.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ type Login struct {
1616
IP string `json:"ip"`
1717
Restricted bool `json:"restricted"`
1818
Username string `json:"username"`
19+
Status string `json:"status"`
1920
}
2021

2122
type LoginsPagedResponse struct {

test/integration/account_logins_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,8 @@ func TestAccountLogins_List(t *testing.T) {
2929
if response.Username != login.Username {
3030
t.Fatal("Recieved Account Login Username does not match source")
3131
}
32+
33+
if response.Status != "successful" && response.Status != "failed" {
34+
t.Fatal("Recieved invalid Account Login Status")
35+
}
3236
}
Lines changed: 125 additions & 232 deletions
Original file line numberDiff line numberDiff line change
@@ -1,235 +1,128 @@
11
---
22
version: 1
33
interactions:
4-
- request:
5-
body: ""
6-
form: {}
7-
headers:
8-
Accept:
9-
- application/json
10-
Content-Type:
11-
- application/json
12-
User-Agent:
13-
- linodego/dev https://github.com/linode/linodego
14-
url: https://api.linode.com/v4beta/account/logins
15-
method: GET
16-
response:
17-
body:
18-
'{"data": [{"id": 1563764434, "datetime": "2018-01-02T03:04:05", "ip": "1234::5678",
19-
"username": "jcallahan-akamai", "restricted": false}, {"id": 1563766105, "datetime":
20-
"2018-01-02T03:04:05", "ip": "1234::5678", "username":
21-
"jcallahan-akamai", "restricted": false}, {"id": 1563766117, "datetime": "2018-01-02T03:04:05",
22-
"ip": "1234::5678", "username": "jcallahan-akamai",
23-
"restricted": false}, {"id": 1563766137, "datetime": "2018-01-02T03:04:05",
24-
"ip": "1234::5678", "username": "jcallahan-akamai",
25-
"restricted": false}, {"id": 1563766144, "datetime": "2018-01-02T03:04:05",
26-
"ip": "1234::5678", "username": "jcallahan-akamai",
27-
"restricted": false}, {"id": 1563766178, "datetime": "2018-01-02T03:04:05",
28-
"ip": "1234::5678", "username": "jcallahan-akamai",
29-
"restricted": false}, {"id": 1563766223, "datetime": "2018-01-02T03:04:05",
30-
"ip": "1234::5678", "username": "jcallahan-akamai",
31-
"restricted": false}, {"id": 1563767269, "datetime": "2018-01-02T03:04:05",
32-
"ip": "1234::5678", "username": "jcallahan-akamai",
33-
"restricted": false}, {"id": 1563767285, "datetime": "2018-01-02T03:04:05",
34-
"ip": "1234::5678", "username": "jcallahan-akamai",
35-
"restricted": false}, {"id": 1563767367, "datetime": "2018-01-02T03:04:05",
36-
"ip": "1234::5678", "username": "jcallahan-akamai",
37-
"restricted": false}, {"id": 1563768248, "datetime": "2018-01-02T03:04:05",
38-
"ip": "1234::5678", "username": "jcallahan-akamai",
39-
"restricted": false}, {"id": 1563768690, "datetime": "2018-01-02T03:04:05",
40-
"ip": "1234::5678", "username": "jcallahan-akamai",
41-
"restricted": false}, {"id": 1563768714, "datetime": "2018-01-02T03:04:05",
42-
"ip": "1234::5678", "username": "jcallahan-akamai",
43-
"restricted": false}, {"id": 1563768738, "datetime": "2018-01-02T03:04:05",
44-
"ip": "1234::5678", "username": "jcallahan-akamai",
45-
"restricted": false}, {"id": 1563768843, "datetime": "2018-01-02T03:04:05",
46-
"ip": "1234::5678", "username": "jcallahan-akamai",
47-
"restricted": false}, {"id": 1563768877, "datetime": "2018-01-02T03:04:05",
48-
"ip": "1234::5678", "username": "jcallahan-akamai",
49-
"restricted": false}, {"id": 1563768895, "datetime": "2018-01-02T03:04:05",
50-
"ip": "1234::5678", "username": "jcallahan-akamai",
51-
"restricted": false}, {"id": 1563768903, "datetime": "2018-01-02T03:04:05",
52-
"ip": "1234::5678", "username": "jcallahan-akamai",
53-
"restricted": false}, {"id": 1563768932, "datetime": "2018-01-02T03:04:05",
54-
"ip": "1234::5678", "username": "jcallahan-akamai",
55-
"restricted": false}, {"id": 1563768964, "datetime": "2018-01-02T03:04:05",
56-
"ip": "1234::5678", "username": "jcallahan-akamai",
57-
"restricted": false}, {"id": 1563769090, "datetime": "2018-01-02T03:04:05",
58-
"ip": "1234::5678", "username": "jcallahan-akamai",
59-
"restricted": false}, {"id": 1563769181, "datetime": "2018-01-02T03:04:05",
60-
"ip": "1234::5678", "username": "jcallahan-akamai",
61-
"restricted": false}, {"id": 1563769187, "datetime": "2018-01-02T03:04:05",
62-
"ip": "1234::5678", "username": "jcallahan-akamai",
63-
"restricted": false}, {"id": 1563769197, "datetime": "2018-01-02T03:04:05",
64-
"ip": "1234::5678", "username": "jcallahan-akamai",
65-
"restricted": false}, {"id": 1563769203, "datetime": "2018-01-02T03:04:05",
66-
"ip": "1234::5678", "username": "jcallahan-akamai",
67-
"restricted": false}, {"id": 1563769212, "datetime": "2018-01-02T03:04:05",
68-
"ip": "1234::5678", "username": "jcallahan-akamai",
69-
"restricted": false}, {"id": 1563769269, "datetime": "2018-01-02T03:04:05",
70-
"ip": "1234::5678", "username": "jcallahan-akamai",
71-
"restricted": false}, {"id": 1563769345, "datetime": "2018-01-02T03:04:05",
72-
"ip": "1234::5678", "username": "jcallahan-akamai",
73-
"restricted": false}, {"id": 1563769542, "datetime": "2018-01-02T03:04:05",
74-
"ip": "1234::5678", "username": "jcallahan-akamai",
75-
"restricted": false}, {"id": 1563769553, "datetime": "2018-01-02T03:04:05",
76-
"ip": "1234::5678", "username": "jcallahan-akamai",
77-
"restricted": false}, {"id": 1563769590, "datetime": "2018-01-02T03:04:05",
78-
"ip": "1234::5678", "username": "jcallahan-akamai",
79-
"restricted": false}, {"id": 1563769598, "datetime": "2018-01-02T03:04:05",
80-
"ip": "1234::5678", "username": "jcallahan-akamai",
81-
"restricted": false}, {"id": 1563769637, "datetime": "2018-01-02T03:04:05",
82-
"ip": "1234::5678", "username": "jcallahan-akamai",
83-
"restricted": false}, {"id": 1563769643, "datetime": "2018-01-02T03:04:05",
84-
"ip": "1234::5678", "username": "jcallahan-akamai",
85-
"restricted": false}, {"id": 1563769670, "datetime": "2018-01-02T03:04:05",
86-
"ip": "1234::5678", "username": "jcallahan-akamai",
87-
"restricted": false}, {"id": 1563769682, "datetime": "2018-01-02T03:04:05",
88-
"ip": "1234::5678", "username": "jcallahan-akamai",
89-
"restricted": false}, {"id": 1563769733, "datetime": "2018-01-02T03:04:05",
90-
"ip": "1234::5678", "username": "jcallahan-akamai",
91-
"restricted": false}, {"id": 1563780234, "datetime": "2018-01-02T03:04:05",
92-
"ip": "1234::5678", "username": "jcallahan-akamai",
93-
"restricted": false}, {"id": 1563782760, "datetime": "2018-01-02T03:04:05",
94-
"ip": "1234::5678", "username": "jcallahan-akamai", "restricted": false}, {"id":
95-
1563783100, "datetime": "2018-01-02T03:04:05", "ip": "1234::5678", "username":
96-
"jcallahan-akamai", "restricted": false}, {"id": 1563783225, "datetime": "2018-01-02T03:04:05",
97-
"ip": "1234::5678", "username": "jcallahan-akamai", "restricted": false}, {"id":
98-
1563861195, "datetime": "2018-01-02T03:04:05", "ip": "1234::5678", "username":
99-
"jcallahan-akamai", "restricted": false}, {"id": 1563880170, "datetime": "2018-01-02T03:04:05",
100-
"ip": "1234::5678", "username": "jcallahan-akamai",
101-
"restricted": false}, {"id": 1563880322, "datetime": "2018-01-02T03:04:05",
102-
"ip": "1234::5678", "username": "jcallahan-akamai",
103-
"restricted": false}, {"id": 1563884474, "datetime": "2018-01-02T03:04:05",
104-
"ip": "1234::5678", "username": "jcallahan-akamai", "restricted": false}, {"id":
105-
1563884499, "datetime": "2018-01-02T03:04:05", "ip": "1234::5678", "username":
106-
"jcallahan-akamai", "restricted": false}, {"id": 1563884546, "datetime": "2018-01-02T03:04:05",
107-
"ip": "1234::5678", "username": "jcallahan-akamai", "restricted": false}, {"id":
108-
1563898248, "datetime": "2018-01-02T03:04:05", "ip": "1234::5678",
109-
"username": "jcallahan-akamai", "restricted": false}, {"id": 1563947199, "datetime":
110-
"2018-01-02T03:04:05", "ip": "172.104.2.4", "username": "jcallahan-akamai",
111-
"restricted": false}, {"id": 1563948262, "datetime": "2018-01-02T03:04:05",
112-
"ip": "172.104.2.4", "username": "jcallahan-akamai", "restricted": false}, {"id":
113-
1563961039, "datetime": "2018-01-02T03:04:05", "ip": "1234::5678", "username":
114-
"jcallahan-akamai", "restricted": false}, {"id": 1563961386, "datetime": "2018-01-02T03:04:05",
115-
"ip": "1234::5678", "username": "jcallahan-akamai", "restricted": false}, {"id":
116-
1563966007, "datetime": "2018-01-02T03:04:05", "ip": "1234::5678",
117-
"username": "jcallahan-akamai", "restricted": false}, {"id": 1563977382, "datetime":
118-
"2018-01-02T03:04:05", "ip": "172.104.2.4", "username": "jcallahan-akamai",
119-
"restricted": false}, {"id": 1563996063, "datetime": "2018-01-02T03:04:05",
120-
"ip": "172.104.2.4", "username": "jcallahan-akamai", "restricted": false}, {"id":
121-
1563998765, "datetime": "2018-01-02T03:04:05", "ip": "172.104.2.4", "username":
122-
"jcallahan-akamai", "restricted": false}, {"id": 1563998782, "datetime": "2018-01-02T03:04:05",
123-
"ip": "172.104.2.4", "username": "jcallahan-akamai", "restricted": false}, {"id":
124-
1563998798, "datetime": "2018-01-02T03:04:05", "ip": "172.104.2.4", "username":
125-
"jcallahan-akamai", "restricted": false}, {"id": 1563998931, "datetime": "2018-01-02T03:04:05",
126-
"ip": "172.104.2.4", "username": "jcallahan-akamai", "restricted": false}, {"id":
127-
1563998958, "datetime": "2018-01-02T03:04:05", "ip": "172.104.2.4", "username":
128-
"jcallahan-akamai", "restricted": false}, {"id": 1563998998, "datetime": "2018-01-02T03:04:05",
129-
"ip": "172.104.2.4", "username": "jcallahan-akamai", "restricted": false}, {"id":
130-
1564000367, "datetime": "2018-01-02T03:04:05", "ip": "172.104.2.4", "username":
131-
"jcallahan-akamai", "restricted": false}, {"id": 1564003326, "datetime": "2018-01-02T03:04:05",
132-
"ip": "1234::5678", "username": "jcallahan-akamai",
133-
"restricted": false}, {"id": 1564037775, "datetime": "2018-01-02T03:04:05",
134-
"ip": "1234::5678", "username": "jcallahan-akamai", "restricted": false}],
135-
"page": 1, "pages": 1, "results": 64}'
136-
headers:
137-
Access-Control-Allow-Credentials:
138-
- "true"
139-
Access-Control-Allow-Headers:
140-
- Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter
141-
Access-Control-Allow-Methods:
142-
- HEAD, GET, OPTIONS, POST, PUT, DELETE
143-
Access-Control-Allow-Origin:
144-
- "*"
145-
Access-Control-Expose-Headers:
146-
- X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status
147-
Cache-Control:
148-
- private, max-age=0, s-maxage=0, no-cache, no-store
149-
- private, max-age=60, s-maxage=60
150-
Content-Security-Policy:
151-
- default-src 'none'
152-
Content-Type:
153-
- application/json
154-
Server:
155-
- nginx
156-
Strict-Transport-Security:
157-
- max-age=31536000
158-
Vary:
159-
- Authorization, X-Filter
160-
- Authorization, X-Filter
161-
X-Accepted-Oauth-Scopes:
162-
- account:read_only
163-
X-Content-Type-Options:
164-
- nosniff
165-
X-Frame-Options:
166-
- DENY
167-
- DENY
168-
X-Oauth-Scopes:
169-
- "*"
170-
X-Ratelimit-Limit:
171-
- "800"
172-
X-Xss-Protection:
173-
- 1; mode=block
174-
status: 200 OK
175-
code: 200
176-
duration: ""
177-
- request:
178-
body: ""
179-
form: {}
180-
headers:
181-
Accept:
182-
- application/json
183-
Content-Type:
184-
- application/json
185-
User-Agent:
186-
- linodego/dev https://github.com/linode/linodego
187-
url: https://api.linode.com/v4beta/account/logins/1563764434
188-
method: GET
189-
response:
190-
body:
191-
'{"id": 1563764434, "datetime": "2018-01-02T03:04:05", "ip": "1234::5678",
192-
"username": "jcallahan-akamai", "restricted": false}'
193-
headers:
194-
Access-Control-Allow-Credentials:
195-
- "true"
196-
Access-Control-Allow-Headers:
197-
- Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter
198-
Access-Control-Allow-Methods:
199-
- HEAD, GET, OPTIONS, POST, PUT, DELETE
200-
Access-Control-Allow-Origin:
201-
- "*"
202-
Access-Control-Expose-Headers:
203-
- X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status
204-
Cache-Control:
205-
- private, max-age=0, s-maxage=0, no-cache, no-store
206-
- private, max-age=60, s-maxage=60
207-
Content-Length:
208-
- "153"
209-
Content-Security-Policy:
210-
- default-src 'none'
211-
Content-Type:
212-
- application/json
213-
Server:
214-
- nginx
215-
Strict-Transport-Security:
216-
- max-age=31536000
217-
Vary:
218-
- Authorization, X-Filter
219-
- Authorization, X-Filter
220-
X-Accepted-Oauth-Scopes:
221-
- account:read_only
222-
X-Content-Type-Options:
223-
- nosniff
224-
X-Frame-Options:
225-
- DENY
226-
- DENY
227-
X-Oauth-Scopes:
228-
- "*"
229-
X-Ratelimit-Limit:
230-
- "800"
231-
X-Xss-Protection:
232-
- 1; mode=block
233-
status: 200 OK
234-
code: 200
235-
duration: ""
4+
- request:
5+
body: ""
6+
form: {}
7+
headers:
8+
Accept:
9+
- application/json
10+
Content-Type:
11+
- application/json
12+
User-Agent:
13+
- linodego/dev https://github.com/linode/linodego
14+
url: https://api.linode.com/v4beta/account/logins
15+
method: GET
16+
response:
17+
body: '{"data": [{"id": 1563948056, "datetime": "2018-01-02T03:04:05", "ip": "1234::5678",
18+
"username": "ErikZilber", "status": "successful", "restricted": false}, {"id":
19+
1563982298, "datetime": "2018-01-02T03:04:05", "ip": "24.63.69.52", "username":
20+
"ErikZilber", "status": "successful", "restricted": false}, {"id": 1564542275,
21+
"datetime": "2018-01-02T03:04:05", "ip": "1234::5678",
22+
"username": "ErikZilber", "status": "failed", "restricted": false}, {"id": 1564542300,
23+
"datetime": "2018-01-02T03:04:05", "ip": "1234::5678",
24+
"username": "ErikZilber", "status": "successful", "restricted": false}, {"id":
25+
1564542307, "datetime": "2018-01-02T03:04:05", "ip": "1234::5678",
26+
"username": "ErikZilber", "status": "successful", "restricted": false}], "page":
27+
1, "pages": 1, "results": 5}'
28+
headers:
29+
Access-Control-Allow-Credentials:
30+
- "true"
31+
Access-Control-Allow-Headers:
32+
- Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter
33+
Access-Control-Allow-Methods:
34+
- HEAD, GET, OPTIONS, POST, PUT, DELETE
35+
Access-Control-Allow-Origin:
36+
- '*'
37+
Access-Control-Expose-Headers:
38+
- X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status
39+
Cache-Control:
40+
- private, max-age=0, s-maxage=0, no-cache, no-store
41+
- private, max-age=60, s-maxage=60
42+
Content-Length:
43+
- "878"
44+
Content-Security-Policy:
45+
- default-src 'none'
46+
Content-Type:
47+
- application/json
48+
Server:
49+
- nginx
50+
Strict-Transport-Security:
51+
- max-age=31536000
52+
Vary:
53+
- Authorization, X-Filter
54+
- Authorization, X-Filter
55+
X-Accepted-Oauth-Scopes:
56+
- account:read_only
57+
X-Content-Type-Options:
58+
- nosniff
59+
X-Frame-Options:
60+
- DENY
61+
- DENY
62+
X-Oauth-Scopes:
63+
- '*'
64+
X-Ratelimit-Limit:
65+
- "800"
66+
X-Xss-Protection:
67+
- 1; mode=block
68+
status: 200 OK
69+
code: 200
70+
duration: ""
71+
- request:
72+
body: ""
73+
form: {}
74+
headers:
75+
Accept:
76+
- application/json
77+
Content-Type:
78+
- application/json
79+
User-Agent:
80+
- linodego/dev https://github.com/linode/linodego
81+
url: https://api.linode.com/v4beta/account/logins/1563948056
82+
method: GET
83+
response:
84+
body: '{"id": 1563948056, "datetime": "2018-01-02T03:04:05", "ip": "1234::5678",
85+
"username": "ErikZilber", "status": "successful", "restricted": false}'
86+
headers:
87+
Access-Control-Allow-Credentials:
88+
- "true"
89+
Access-Control-Allow-Headers:
90+
- Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter
91+
Access-Control-Allow-Methods:
92+
- HEAD, GET, OPTIONS, POST, PUT, DELETE
93+
Access-Control-Allow-Origin:
94+
- '*'
95+
Access-Control-Expose-Headers:
96+
- X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status
97+
Cache-Control:
98+
- private, max-age=0, s-maxage=0, no-cache, no-store
99+
- private, max-age=60, s-maxage=60
100+
Content-Length:
101+
- "170"
102+
Content-Security-Policy:
103+
- default-src 'none'
104+
Content-Type:
105+
- application/json
106+
Server:
107+
- nginx
108+
Strict-Transport-Security:
109+
- max-age=31536000
110+
Vary:
111+
- Authorization, X-Filter
112+
- Authorization, X-Filter
113+
X-Accepted-Oauth-Scopes:
114+
- account:read_only
115+
X-Content-Type-Options:
116+
- nosniff
117+
X-Frame-Options:
118+
- DENY
119+
- DENY
120+
X-Oauth-Scopes:
121+
- '*'
122+
X-Ratelimit-Limit:
123+
- "800"
124+
X-Xss-Protection:
125+
- 1; mode=block
126+
status: 200 OK
127+
code: 200
128+
duration: ""

0 commit comments

Comments
 (0)