external

package
v0.22.58 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2025 License: Apache-2.0 Imports: 16 Imported by: 9

Documentation

Index

Constants

View Source
const (
	UCloudPublicKeyEnvVar = "UCLOUD_PUBLIC_KEY"

	UCloudPrivateKeyEnvVar = "UCLOUD_PRIVATE_KEY"

	UCloudProjectIdEnvVar = "UCLOUD_PROJECT_ID"

	UCloudRegionEnvVar = "UCLOUD_REGION"

	UCloudZoneEnvVar = "UCLOUD_ZONE"

	UCloudAPIBaseURLEnvVar = "UCLOUD_API_BASE_URL"

	UCloudTimeoutSecondEnvVar = "UCLOUD_TIMEOUT_SECOND"

	UCloudSharedProfileEnvVar = "UCLOUD_PROFILE"

	UCloudSharedConfigFileEnvVar = "UCLOUD_SHARED_CONFIG_FILE"

	UCloudSharedCredentialFileEnvVar = "UCLOUD_SHARED_CREDENTIAL_FILE"
)
View Source
const DefaultProfile = "default"

DefaultProfile is the default named profile for ucloud sdk

Variables

This section is empty.

Functions

func DefaultSharedConfigFile

func DefaultSharedConfigFile() string

DefaultSharedConfigFile will return the default shared config filename

func DefaultSharedCredentialsFile

func DefaultSharedCredentialsFile() string

DefaultSharedCredentialsFile will return the default shared credential filename

func LoadUCloudConfigFile

func LoadUCloudConfigFile(cfgFile, profile string) (*ucloud.Config, error)

LoadUCloudConfigFile will load ucloud client config from config file

func LoadUCloudCredentialFile

func LoadUCloudCredentialFile(credFile, profile string) (*auth.Credential, error)

LoadUCloudCredentialFile will load ucloud credential config from config file

Types

type AssumeRoleRequest added in v0.12.0

type AssumeRoleRequest struct {
	RoleName string
}

type AssumeRoleV2Request added in v0.22.57

type AssumeRoleV2Request struct {
	// RoleName is the name of the role to assume (required)
	RoleName string

	// DurationSeconds specifies the duration of the STS token in seconds
	// Default is 3600 seconds (1 hour) if not specified
	// Valid range: 900-3600 (15 minutes to 1 hour)
	DurationSeconds int

	// SessionName is the name of the session (optional)
	// Used for auditing and tracking purposes
	SessionName string

	// RolePolicy is an additional policy to further restrict the STS token permissions
	// Should be base64 encoded JSON string (optional)
	RolePolicy string
}

AssumeRoleV2Request is the request for STS V2 API Supports V2 API parameters via HTTP headers

type ClientConfigProvider added in v0.12.0

type ClientConfigProvider interface {
	Config() *ucloud.Config
}

ClientConfigProvider is the provider to store and provide config instance

type ConfigProvider

type ConfigProvider interface {
	CredentialProvider
	ClientConfigProvider
}

ConfigProvider is the provider to store and provide config/credential instance

func LoadDefaultUCloudConfig

func LoadDefaultUCloudConfig() (ConfigProvider, error)

LoadDefaultUCloudConfig is the default loader to load config

func LoadSTSConfig added in v0.12.0

func LoadSTSConfig(req AssumeRoleRequest) (ConfigProvider, error)

func LoadSTSConfigV2 added in v0.22.57

func LoadSTSConfigV2(req AssumeRoleV2Request) (ConfigProvider, error)

LoadSTSConfigV2 loads STS V2 configuration from UCloud metadata service

type CredentialProvider added in v0.12.0

type CredentialProvider interface {
	Credential() *auth.Credential
}

CredentialProvider is the provider to store and provide credential instance

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL