Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func coupleAPIErrorsHTTP(resp *http.Response, err error) (*http.Response, error)
}

func (e APIError) Error() string {
x := []string{}
x := make([]string, 0, len(e.Errors))
for _, msg := range e.Errors {
x = append(x, msg.Error())
}
Expand Down
291 changes: 291 additions & 0 deletions test/integration/fixtures/TestIAM_GetAccountRolePermissions.yaml

Large diffs are not rendered by default.

198 changes: 198 additions & 0 deletions test/integration/fixtures/TestIAM_GetEntityRoles.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
---
version: 1
interactions:
- request:
body: ""
form: {}
headers:
Accept:
- application/json
Content-Type:
- application/json
User-Agent:
- linodego/dev https://github.com/linode/linodego
url: https://api.linode.com/v4beta/profile
method: GET
response:
body: '{"uid": 2897900, "username": "prod-test-022", "email": "dl-linode-devs@akamai.com",
"verified_phone_number": null, "timezone": "GMT", "email_notifications": true,
"referrals": {"code": "", "url": "", "total": 0, "completed": 0, "pending":
0, "credit": 0}, "ip_whitelist_enabled": false, "lish_auth_method": "password_keys",
"authorized_keys": null, "two_factor_auth": true, "restricted": false, "authentication_type":
"password", "user_type": "default"}'
headers:
Access-Control-Allow-Credentials:
- "true"
Access-Control-Allow-Headers:
- Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter
Access-Control-Allow-Methods:
- HEAD, GET, OPTIONS, POST, PUT, DELETE
Access-Control-Allow-Origin:
- '*'
Access-Control-Expose-Headers:
- X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status
Akamai-Internal-Account:
- '*'
Cache-Control:
- max-age=0, no-cache, no-store
Connection:
- keep-alive
Content-Length:
- "453"
Content-Security-Policy:
- default-src 'none'
Content-Type:
- application/json
Expires:
- Mon, 22 Dec 2025 10:21:33 GMT
Pragma:
- no-cache
Strict-Transport-Security:
- max-age=31536000
Vary:
- Authorization, X-Filter
- Authorization, X-Filter
X-Accepted-Oauth-Scopes:
- '*'
X-Content-Type-Options:
- nosniff
X-Frame-Options:
- DENY
- DENY
X-Oauth-Scopes:
- '*'
X-Ratelimit-Limit:
- "1840"
X-Xss-Protection:
- 1; mode=block
status: 200 OK
code: 200
duration: ""
- request:
body: ""
form: {}
headers:
Accept:
- application/json
Content-Type:
- application/json
User-Agent:
- linodego/dev https://github.com/linode/linodego
url: https://api.linode.com/v4beta/entities?page=1
method: GET
response:
body: '{"data": [{"id": 3621380, "label": "cloudfw-1766398891376188000", "type":
"firewall"}], "page": 1, "pages": 1, "results": 1}'
headers:
Access-Control-Allow-Credentials:
- "true"
Access-Control-Allow-Headers:
- Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter
Access-Control-Allow-Methods:
- HEAD, GET, OPTIONS, POST, PUT, DELETE
Access-Control-Allow-Origin:
- '*'
Access-Control-Expose-Headers:
- X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status
Akamai-Internal-Account:
- '*'
Cache-Control:
- max-age=0, no-cache, no-store
Connection:
- keep-alive
Content-Length:
- "124"
Content-Security-Policy:
- default-src 'none'
Content-Type:
- application/json
Expires:
- Mon, 22 Dec 2025 10:21:34 GMT
Pragma:
- no-cache
Strict-Transport-Security:
- max-age=31536000
Vary:
- Authorization, X-Filter
- Authorization, X-Filter
X-Accepted-Oauth-Scopes:
- account:read_only
X-Content-Type-Options:
- nosniff
X-Frame-Options:
- DENY
- DENY
X-Oauth-Scopes:
- '*'
X-Ratelimit-Limit:
- "1840"
X-Xss-Protection:
- 1; mode=block
status: 200 OK
code: 200
duration: ""
- request:
body: ""
form: {}
headers:
Accept:
- application/json
Content-Type:
- application/json
User-Agent:
- linodego/dev https://github.com/linode/linodego
url: https://api.linode.com/v4beta/iam/users/prod-test-022/permissions/firewall/3621380
method: GET
response:
body: '["view_firewall", "list_firewall_rules", "view_firewall_device", "update_firewall",
"delete_firewall_device", "update_firewall_rules", "list_firewall_devices",
"delete_firewall", "list_firewall_rule_versions", "view_firewall_rule_version",
"create_firewall_device"]'
headers:
Access-Control-Allow-Credentials:
- "true"
Access-Control-Allow-Headers:
- Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter
Access-Control-Allow-Methods:
- HEAD, GET, OPTIONS, POST, PUT, DELETE
Access-Control-Allow-Origin:
- '*'
Access-Control-Expose-Headers:
- X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status
Akamai-Internal-Account:
- '*'
Cache-Control:
- max-age=0, no-cache, no-store
Connection:
- keep-alive
Content-Length:
- "265"
Content-Security-Policy:
- default-src 'none'
Content-Type:
- application/json
Expires:
- Mon, 22 Dec 2025 10:21:34 GMT
Pragma:
- no-cache
Strict-Transport-Security:
- max-age=31536000
Vary:
- Authorization, X-Filter
- Authorization, X-Filter
X-Accepted-Oauth-Scopes:
- account:read_only
X-Content-Type-Options:
- nosniff
X-Frame-Options:
- DENY
- DENY
X-Oauth-Scopes:
- '*'
X-Ratelimit-Limit:
- "1840"
X-Xss-Protection:
- 1; mode=block
status: 200 OK
code: 200
duration: ""
147 changes: 147 additions & 0 deletions test/integration/fixtures/TestIAM_GetUserAccountPermissions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
---
version: 1
interactions:
- request:
body: ""
form: {}
headers:
Accept:
- application/json
Content-Type:
- application/json
User-Agent:
- linodego/dev https://github.com/linode/linodego
url: https://api.linode.com/v4beta/profile
method: GET
response:
body: '{"uid": 2897900, "username": "prod-test-022", "email": "dl-linode-devs@akamai.com",
"verified_phone_number": null, "timezone": "GMT", "email_notifications": true,
"referrals": {"code": "", "url": "", "total": 0, "completed": 0, "pending":
0, "credit": 0}, "ip_whitelist_enabled": false, "lish_auth_method": "password_keys",
"authorized_keys": null, "two_factor_auth": true, "restricted": false, "authentication_type":
"password", "user_type": "default"}'
headers:
Access-Control-Allow-Credentials:
- "true"
Access-Control-Allow-Headers:
- Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter
Access-Control-Allow-Methods:
- HEAD, GET, OPTIONS, POST, PUT, DELETE
Access-Control-Allow-Origin:
- '*'
Access-Control-Expose-Headers:
- X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status
Akamai-Internal-Account:
- '*'
Cache-Control:
- max-age=0, no-cache, no-store
Connection:
- keep-alive
Content-Length:
- "453"
Content-Security-Policy:
- default-src 'none'
Content-Type:
- application/json
Expires:
- Mon, 22 Dec 2025 10:21:37 GMT
Pragma:
- no-cache
Strict-Transport-Security:
- max-age=31536000
Vary:
- Authorization, X-Filter
- Authorization, X-Filter
X-Accepted-Oauth-Scopes:
- '*'
X-Content-Type-Options:
- nosniff
X-Frame-Options:
- DENY
- DENY
X-Oauth-Scopes:
- '*'
X-Ratelimit-Limit:
- "1840"
X-Xss-Protection:
- 1; mode=block
status: 200 OK
code: 200
duration: ""
- request:
body: ""
form: {}
headers:
Accept:
- application/json
Content-Type:
- application/json
User-Agent:
- linodego/dev https://github.com/linode/linodego
url: https://api.linode.com/v4beta/iam/users/prod-test-022/permissions/account
method: GET
response:
body: '["list_events", "view_account_settings", "view_invoice_item", "cancel_account",
"create_vpc", "create_payment_method", "reset_oauth_client_secret", "list_account_logins",
"delete_oauth_client", "update_delegate_users", "enable_managed", "set_default_payment_method",
"upload_image", "update_oauth_client_thumbnail", "make_billing_payment", "list_vpcs_ip_addresses",
"list_delegate_users", "view_event", "mark_event_seen", "list_account_agreements",
"list_invoice_items", "list_billing_payments", "enroll_beta_program", "view_enrolled_beta_program",
"update_oauth_client", "view_service_transfer", "list_all_child_accounts", "create_oauth_client",
"is_account_admin", "create_user", "view_account_login", "create_image", "create_linode",
"view_account", "update_account_settings", "list_notifications", "delete_payment_method",
"update_account", "view_billing_invoice", "view_payment_method", "list_service_transfers",
"list_maintenances", "list_user_delegate_accounts", "create_nodebalancer", "create_service_transfer",
"list_enrolled_beta_programs", "list_billing_invoices", "cancel_service_transfer",
"update_default_firewalls", "view_payment_client_token", "list_default_firewalls",
"view_oauth_client", "list_payment_methods", "acknowledge_account_agreement",
"create_promo_code", "view_network_usage", "list_oauth_clients", "update_default_delegate_access",
"create_volume", "view_billing_payment", "create_firewall", "view_region_available_service",
"accept_service_transfer", "list_available_services"]'
headers:
Access-Control-Allow-Credentials:
- "true"
Access-Control-Allow-Headers:
- Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter
Access-Control-Allow-Methods:
- HEAD, GET, OPTIONS, POST, PUT, DELETE
Access-Control-Allow-Origin:
- '*'
Access-Control-Expose-Headers:
- X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status
Akamai-Internal-Account:
- '*'
Cache-Control:
- max-age=0, no-cache, no-store
Connection:
- keep-alive
Content-Security-Policy:
- default-src 'none'
Content-Type:
- application/json
Expires:
- Mon, 22 Dec 2025 10:21:37 GMT
Pragma:
- no-cache
Strict-Transport-Security:
- max-age=31536000
Vary:
- Authorization, X-Filter
- Authorization, X-Filter
- Accept-Encoding
X-Accepted-Oauth-Scopes:
- account:read_only
X-Content-Type-Options:
- nosniff
X-Frame-Options:
- DENY
- DENY
X-Oauth-Scopes:
- '*'
X-Ratelimit-Limit:
- "1840"
X-Xss-Protection:
- 1; mode=block
status: 200 OK
code: 200
duration: ""
Loading