oracle

package
v0.8.10 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 21 Imported by: 3

README

Oracle Provider

This provides Oracle Cloud Infrastructure (OCI) signing support for the FN golang SDK

Configuration:

With the provider set to oracle the following settings apply:

The provider can read most of it's settings from OCI configuration file: (~/.oci/config)

Key Example Required Read from ~/.oci/config Description
api-url https://functions.us-ashburn-1.oraclecloud.com/ Yes No The API endpoint to contact for accessing the service API
oracle.compartment-id ocid1.compartment.oc1..aaaaaaaajvunnz..... Yes No The compartment OCID for the functions tenancy - this corresponds to where you want functions objects to exist in OCI
oracle.tenancy-id ocid1.tenancy.oc1..aaaaaaaai4w6iipzc73k3s2.... No Yes The tenancy of the user accessing the service
oracle.user-id ocid1.user.oc1..aaaaaaaay2df7zq4lgv7.... No Yes The OCID of the user accessing the API
oracle.fingerprint 30:c1:f8:98:38:be:bb... No Yes The RSA key fingerprint of the key being used
oracle.key-file /home/myuser/.oci/private_key.pem No Yes (key_file) The private key for the registered API key
oracle.pass-phrase No Yes (pass_phrase )
oracle.profile No No Defaults to DEFAULT - the OCI Configuration profile to use for reading OCI information
oracle.disable-certs true No No Ignore SSL host name checks when contacting the server (should only be used for diagnosis and testing)

With the provider set to oracle-ip, and the CLI hosted on an OCI instance, the following settings apply:

Key Example Required Read from ~/.oci/config Description
api-url https://functions.us-ashburn-1.oraclecloud.com/ No No The API endpoint to contact for accessing the service API. If unset, it will construct a local endpoint from the instance's region
oracle.compartment-id ocid1.compartment.oc1..aaaaaaaajvunnz..... No No The compartment OCID for the functions tenancy - this corresponds to where you want functions objects to exist in OCI. It defaults to the instance compartment
oracle.disable-certs true No No Ignore SSL host name checks when contacting the server (should only be used for diagnosis and testing)

For the Instance Principal provider, the instance must be in a dynamic group that has been granted the rights to use and/or manage functions, as well as their associated resources.

With the provider set to oracle-cs, and the CLI running on an OCI Cloudshell machine, the following settings apply:

The provider can read most of it's settings from the OCI CLI configuration file: (/etc/oci/config)

Key Example Required Read from OCI CLI Config Description
api-url https://functions.us-ashburn-1.oraclecloud.com/ No No The API endpoint to contact for accessing the service API. If unset, it will construct a local endpoint from the region in the default region OCI CLI profile
oracle.compartment-id ocid1.compartment.oc1..aaaaaaaajvunnz..... No No The compartment OCID for the functions tenancy - this corresponds to where you want functions objects to exist in OCI. It defaults to the root tenancy compartment
oracle.disable-certs true No No Ignore SSL host name checks when contacting the server (should only be used for diagnosis and testing)

Documentation

Index

Constants

View Source
const (
	CfgTenancyID          = "oracle.tenancy-id"
	CfgProfile            = "oracle.profile"
	CfgCompartmentID      = "oracle.compartment-id"
	CfgImageCompartmentID = "oracle.image-compartment-id"
	CfgDisableCerts       = "oracle.disable-certs"
	CompartmentMetadata   = "http://169.254.169.254/opc/v2/instance/compartmentId"
	FunctionsAPIURLTmpl   = "https://functions.%s.oci.%s"

	OCI_CLI_PROFILE_ENV_VAR               = "OCI_CLI_PROFILE"
	OCI_CLI_REGION_ENV_VAR                = "OCI_CLI_REGION"
	OCI_CLI_TENANCY_ENV_VAR               = "OCI_CLI_TENANCY"
	OCI_CLI_CONFIG_FILE_ENV_VAR           = "OCI_CLI_CONFIG_FILE"
	OCI_CLI_DELEGATION_TOKEN_FILE_ENV_VAR = "OCI_CLI_DELEGATION_TOKEN_FILE"
	OCI_CLI_USER_ENV_VAR                  = "OCI_CLI_USER"
	OCI_CLI_FINGERPRINT_ENV_VAR           = "OCI_CLI_FINGERPRINT"
	OCI_CLI_KEY_FILE_ENV_VAR              = "OCI_CLI_KEY_FILE"
)
View Source
const (
	CfgUserID      = "oracle.user-id"
	CfgFingerprint = "oracle.fingerprint"
	CfgKeyFile     = "oracle.key-file"
	CfgPassPhrase  = "oracle.pass-phrase"
)
View Source
const (
	DelegationTokenFileLocation = "/etc/oci/delegation_token"
)

Variables

This section is empty.

Functions

func GetOCIRegionTenancy added in v0.5.3

func GetOCIRegionTenancy() (region string, tenancy string, err error)

func GetRealmDomain added in v0.6.0

func GetRealmDomain() (string, error)

Retrieve second-level domain for the current realm from IMDS

func InsecureRoundTripper

func InsecureRoundTripper(roundTripper http.RoundTripper) http.RoundTripper

Skip verification of insecure certs

func NewCSProvider added in v0.5.2

func NewCSProvider(configSource provider.ConfigSource, passphraseSource provider.PassPhraseSource) (provider.Provider, error)

Creates a new "oracle-cs" provider instance for use when Fn is deployed in an OCI CloudShell environment.

func NewFromConfig

func NewFromConfig(configSource provider.ConfigSource, passphraseSource provider.PassPhraseSource) (provider.Provider, error)

func NewIPProvider

func NewIPProvider(configSource provider.ConfigSource, passphraseSource provider.PassPhraseSource) (provider.Provider, error)

Types

type Annotations

type Annotations struct {
	CompartmentID string `json:"oracle.com/oci/compartmentId"`
	ShortCode     string `json:"oracle.com/oci/appCode"`
}

type CloudShellConfig added in v0.5.2

type CloudShellConfig struct {
	// contains filtered or unexported fields
}

Holds the three required config values in a CS env.

type OracleProvider added in v0.5.2

type OracleProvider struct {
	// FnApiUrl is the endpoint to use for API interactions
	FnApiUrl *url.URL

	//Signer performs auth operation
	Signer common.HTTPRequestSigner

	//A request interceptor can be used to customize the request before signing and dispatching
	Interceptor common.RequestInterceptor

	// DisableCerts indicates if server certificates should be ignored - TBD
	DisableCerts bool

	// CompartmentID is the ocid of the functions compartment ID for a given function
	CompartmentID string

	// ImageCompartmentID is the ocid of the functions compartment ID for a given function
	ImageCompartmentID string

	// ConfigurationProvider is the OCI configuration provider for signing requests
	ConfigurationProvider common.ConfigurationProvider
	// contains filtered or unexported fields
}

func (*OracleProvider) APIClientv2 added in v0.5.2

func (op *OracleProvider) APIClientv2() *clientv2.Fn

func (*OracleProvider) APIURL added in v0.5.2

func (op *OracleProvider) APIURL() *url.URL

func (*OracleProvider) UnavailableResources added in v0.5.2

func (op *OracleProvider) UnavailableResources() []provider.FnResourceType

func (*OracleProvider) VersionClient added in v0.5.2

func (op *OracleProvider) VersionClient() *version.Client

func (*OracleProvider) WrapCallTransport added in v0.5.2

func (op *OracleProvider) WrapCallTransport(roundTripper http.RoundTripper) http.RoundTripper

type Response

type Response struct {
	Annotations Annotations `json:"annotations"`
	CreatedAt   string      `json:"created_at"`
	UpdatedAt   string      `json:"updated_at"`
	Name        string      `json:"name"`
	Shape       string      `json:shape`
}

Directories

Path Synopsis
client
Package client is a generated GoMock package.
Package client is a generated GoMock package.

Jump to

Keyboard shortcuts

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