Documentation ¶
Index ¶
- Constants
- Variables
- func HandleCreateApplicationCredentialSuccessfully(t *testing.T)
- func HandleCreateNoSecretApplicationCredentialSuccessfully(t *testing.T)
- func HandleCreateUnrestrictedApplicationCredentialSuccessfully(t *testing.T)
- func HandleDeleteAccessRuleSuccessfully(t *testing.T)
- func HandleDeleteApplicationCredentialSuccessfully(t *testing.T)
- func HandleGetAccessRuleSuccessfully(t *testing.T)
- func HandleGetApplicationCredentialSuccessfully(t *testing.T)
- func HandleListAccessRulesSuccessfully(t *testing.T)
- func HandleListApplicationCredentialsSuccessfully(t *testing.T)
Constants ¶
const CreateNoSecretRequest = `` /* 173-byte string literal not displayed */
CreateNoOptionsRequest provides the input to a Create request with no Secret.
const CreateNoSecretResponse = `` /* 571-byte string literal not displayed */
const CreateRequest = `` /* 333-byte string literal not displayed */
CreateRequest provides the input to a Create request.
const CreateResponse = `` /* 747-byte string literal not displayed */
const CreateUnrestrictedRequest = `` /* 286-byte string literal not displayed */
const CreateUnrestrictedResponse = `` /* 721-byte string literal not displayed */
const GetAccessRuleOutput = `` /* 268-byte string literal not displayed */
GetAccessRuleOutput provides a Get result.
const GetOutput = `` /* 721-byte string literal not displayed */
GetOutput provides a Get result.
const ListAccessRulesOutput = `` /* 450-byte string literal not displayed */
ListAccessRulesOutput provides a single page of AccessRules results.
const ListOutput = `` /* 1440-byte string literal not displayed */
ListOutput provides a single page of ApplicationCredential results.
Variables ¶
var AccessRule = applicationcredentials.AccessRule{
Path: "/v2.0/metrics",
ID: "07d719df00f349ef8de77d542edf010c",
Service: "monitoring",
Method: "GET",
}
var ApplationCredentialExpiresAt = time.Date(2019, 3, 12, 12, 12, 12, 123456000, time.UTC)
var ApplicationCredential = applicationcredentials.ApplicationCredential{ ID: "f741662395b249c9b8acdebf1722c5ae", Name: "test", Description: "", Unrestricted: false, Secret: "", ProjectID: "53c2b94f63fb4f43a21b92d119ce549f", Roles: []applicationcredentials.Role{ { ID: "31f87923ae4a4d119aa0b85dcdbeed13", Name: "compute_viewer", }, }, AccessRules: []applicationcredentials.AccessRule{ { ID: "07d719df00f349ef8de77d542edf010c", Path: "/v2.0/metrics", Method: "GET", Service: "monitoring", }, }, ExpiresAt: nilTime, Links: map[string]interface{}{ "self": "https://identity/v3/users/2844b2a08be147a08ef58317d6471f1f/application_credentials/f741662395b249c9b8acdebf1722c5ae", }, }
var ApplicationCredentialNoSecretResponse = applicationcredentials.ApplicationCredential{ ID: "c4859fb437df4b87a51a8f5adcfb0bc7", Name: "test1", Description: "", Unrestricted: false, Secret: "generated_secret", ProjectID: "53c2b94f63fb4f43a21b92d119ce549f", Roles: []applicationcredentials.Role{ { ID: "31f87923ae4a4d119aa0b85dcdbeed13", Name: "compute_viewer", }, }, ExpiresAt: nilTime, Links: map[string]interface{}{ "self": "https://identity/v3/users/2844b2a08be147a08ef58317d6471f1f/application_credentials/c4859fb437df4b87a51a8f5adcfb0bc7", }, }
var ExpectedAccessRulesSlice = []applicationcredentials.AccessRule{ AccessRule, }
var ExpectedApplicationCredentialsSlice = []applicationcredentials.ApplicationCredential{FirstApplicationCredential, SecondApplicationCredential}
ExpectedApplicationCredentialsSlice is the slice of application credentials expected to be returned from ListOutput.
var FirstApplicationCredential = applicationcredentials.ApplicationCredential{ ID: "c4859fb437df4b87a51a8f5adcfb0bc7", Name: "test1", Description: "", Unrestricted: false, Secret: "", ProjectID: "53c2b94f63fb4f43a21b92d119ce549f", Roles: []applicationcredentials.Role{ { ID: "31f87923ae4a4d119aa0b85dcdbeed13", Name: "compute_viewer", }, }, ExpiresAt: nilTime, Links: map[string]interface{}{ "self": "https://identity/v3/users/2844b2a08be147a08ef58317d6471f1f/application_credentials/c4859fb437df4b87a51a8f5adcfb0bc7", }, }
var SecondApplicationCredential = applicationcredentials.ApplicationCredential{ ID: "6b8cc7647da64166a4a3cc0c88ebbabb", Name: "test2", Description: "", Unrestricted: true, Secret: "", ProjectID: "53c2b94f63fb4f43a21b92d119ce549f", Roles: []applicationcredentials.Role{ { ID: "31f87923ae4a4d119aa0b85dcdbeed13", Name: "compute_viewer", }, { ID: "4494bc5bea1a4105ad7fbba6a7eb9ef4", Name: "network_viewer", }, }, ExpiresAt: ApplationCredentialExpiresAt, Links: map[string]interface{}{ "self": "https://identity/v3/users/2844b2a08be147a08ef58317d6471f1f/application_credentials/6b8cc7647da64166a4a3cc0c88ebbabb", }, }
var UnrestrictedApplicationCredential = applicationcredentials.ApplicationCredential{ ID: "6b8cc7647da64166a4a3cc0c88ebbabb", Name: "test2", Description: "", Unrestricted: true, Secret: "", ProjectID: "53c2b94f63fb4f43a21b92d119ce549f", Roles: []applicationcredentials.Role{ { ID: "31f87923ae4a4d119aa0b85dcdbeed13", Name: "compute_viewer", }, { ID: "4494bc5bea1a4105ad7fbba6a7eb9ef4", Name: "network_viewer", }, }, ExpiresAt: ApplationCredentialExpiresAt, Links: map[string]interface{}{ "self": "https://identity/v3/users/2844b2a08be147a08ef58317d6471f1f/application_credentials/6b8cc7647da64166a4a3cc0c88ebbabb", }, }
Functions ¶
func HandleCreateApplicationCredentialSuccessfully ¶
HandleCreateApplicationCredentialSuccessfully creates an HTTP handler at `/users` on the test handler mux that tests application credential creation.
func HandleCreateNoSecretApplicationCredentialSuccessfully ¶
HandleCreateNoOptionsApplicationCredentialSuccessfully creates an HTTP handler at `/users` on the test handler mux that tests application credential creation.
func HandleDeleteAccessRuleSuccessfully ¶
HandleDeleteAccessRuleSuccessfully creates an HTTP handler at `/users` on the test handler mux that tests application credential deletion.
func HandleDeleteApplicationCredentialSuccessfully ¶
HandleDeleteApplicationCredentialSuccessfully creates an HTTP handler at `/users` on the test handler mux that tests application credential deletion.
func HandleGetAccessRuleSuccessfully ¶
HandleGetAccessRuleSuccessfully creates an HTTP handler at `/users` on the test handler mux that responds with a single application credential.
func HandleGetApplicationCredentialSuccessfully ¶
HandleGetApplicationCredentialSuccessfully creates an HTTP handler at `/users` on the test handler mux that responds with a single application credential.
func HandleListAccessRulesSuccessfully ¶
HandleListAccessRulesSuccessfully creates an HTTP handler at `/users` on the test handler mux that responds with a list of two applicationcredentials.
func HandleListApplicationCredentialsSuccessfully ¶
HandleListApplicationCredentialsSuccessfully creates an HTTP handler at `/users` on the test handler mux that responds with a list of two applicationcredentials.
Types ¶
This section is empty.