testing

package
Version: v0.21.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const CreateNoSecretRequest = `` /* 173-byte string literal not displayed */

CreateNoOptionsRequest provides the input to a Create request with no Secret.

View Source
const CreateNoSecretResponse = `` /* 571-byte string literal not displayed */
View Source
const CreateRequest = `` /* 333-byte string literal not displayed */

CreateRequest provides the input to a Create request.

View Source
const CreateResponse = `` /* 747-byte string literal not displayed */
View Source
const CreateUnrestrictedRequest = `` /* 286-byte string literal not displayed */
View Source
const CreateUnrestrictedResponse = `` /* 721-byte string literal not displayed */
View Source
const GetAccessRuleOutput = `` /* 268-byte string literal not displayed */

GetAccessRuleOutput provides a Get result.

View Source
const GetOutput = `` /* 721-byte string literal not displayed */

GetOutput provides a Get result.

View Source
const ListAccessRulesOutput = `` /* 450-byte string literal not displayed */

ListAccessRulesOutput provides a single page of AccessRules results.

View Source
const ListOutput = `` /* 1440-byte string literal not displayed */

ListOutput provides a single page of ApplicationCredential results.

Variables

View Source
var AccessRule = applicationcredentials.AccessRule{
	Path:    "/v2.0/metrics",
	ID:      "07d719df00f349ef8de77d542edf010c",
	Service: "monitoring",
	Method:  "GET",
}
View Source
var ApplationCredentialExpiresAt = time.Date(2019, 3, 12, 12, 12, 12, 123456000, time.UTC)
View Source
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",
	},
}
View Source
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",
	},
}
View Source
var ExpectedAccessRulesSlice = []applicationcredentials.AccessRule{
	AccessRule,
}

ExpectedApplicationCredentialsSlice is the slice of application credentials expected to be returned from ListOutput.

View Source
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",
	},
}
View Source
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",
	},
}
View Source
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

func HandleCreateApplicationCredentialSuccessfully(t *testing.T)

HandleCreateApplicationCredentialSuccessfully creates an HTTP handler at `/users` on the test handler mux that tests application credential creation.

func HandleCreateNoSecretApplicationCredentialSuccessfully

func HandleCreateNoSecretApplicationCredentialSuccessfully(t *testing.T)

HandleCreateNoOptionsApplicationCredentialSuccessfully creates an HTTP handler at `/users` on the test handler mux that tests application credential creation.

func HandleCreateUnrestrictedApplicationCredentialSuccessfully

func HandleCreateUnrestrictedApplicationCredentialSuccessfully(t *testing.T)

func HandleDeleteAccessRuleSuccessfully added in v0.7.0

func HandleDeleteAccessRuleSuccessfully(t *testing.T)

HandleDeleteAccessRuleSuccessfully creates an HTTP handler at `/users` on the test handler mux that tests application credential deletion.

func HandleDeleteApplicationCredentialSuccessfully

func HandleDeleteApplicationCredentialSuccessfully(t *testing.T)

HandleDeleteApplicationCredentialSuccessfully creates an HTTP handler at `/users` on the test handler mux that tests application credential deletion.

func HandleGetAccessRuleSuccessfully added in v0.7.0

func HandleGetAccessRuleSuccessfully(t *testing.T)

HandleGetAccessRuleSuccessfully creates an HTTP handler at `/users` on the test handler mux that responds with a single application credential.

func HandleGetApplicationCredentialSuccessfully

func HandleGetApplicationCredentialSuccessfully(t *testing.T)

HandleGetApplicationCredentialSuccessfully creates an HTTP handler at `/users` on the test handler mux that responds with a single application credential.

func HandleListAccessRulesSuccessfully added in v0.7.0

func HandleListAccessRulesSuccessfully(t *testing.T)

HandleListAccessRulesSuccessfully creates an HTTP handler at `/users` on the test handler mux that responds with a list of two applicationcredentials.

func HandleListApplicationCredentialsSuccessfully

func HandleListApplicationCredentialsSuccessfully(t *testing.T)

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.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL