oauth2

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 4 Imported by: 10

Documentation

Overview

These APIs allow you to manage Custom App Integration, O Auth Enrollment, Published App Integration, etc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateCustomAppIntegration

type CreateCustomAppIntegration struct {
	// indicates if an oauth client-secret should be generated
	Confidential bool `json:"confidential,omitempty"`
	// The oauth app integration ID.
	IntegrationId string `json:"-" url:"-"`
	// name of the custom oauth app
	Name string `json:"name,omitempty"`
	// List of oauth redirect urls
	RedirectUrls []string `json:"redirect_urls,omitempty"`
	// Token access policy
	TokenAccessPolicy *TokenAccessPolicy `json:"token_access_policy,omitempty"`
}

type CreateCustomAppIntegrationOutput

type CreateCustomAppIntegrationOutput struct {
	// oauth client-id generated by the Databricks
	ClientId string `json:"client_id,omitempty"`
	// oauth client-secret generated by the Databricks if this is a confidential
	// oauth app client-secret will be generated.
	ClientSecret string `json:"client_secret,omitempty"`
	// unique integration id for the custom oauth app
	IntegrationId string `json:"integration_id,omitempty"`
}

type CreateOAuthEnrollment

type CreateOAuthEnrollment struct {
	// If true, enable OAuth for all the published applications in the account.
	EnableAllPublishedApps bool `json:"enable_all_published_apps,omitempty"`
}

type CreatePublishedAppIntegration

type CreatePublishedAppIntegration struct {
	// app_id of the oauth published app integration. For example power-bi,
	// tableau-deskop
	AppId string `json:"app_id,omitempty"`
	// The oauth app integration ID.
	IntegrationId string `json:"-" url:"-"`
	// Token access policy
	TokenAccessPolicy *TokenAccessPolicy `json:"token_access_policy,omitempty"`
}

type CreatePublishedAppIntegrationOutput

type CreatePublishedAppIntegrationOutput struct {
	// unique integration id for the published oauth app
	IntegrationId string `json:"integration_id,omitempty"`
}

type CustomAppIntegrationAPI

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

These APIs enable administrators to manage custom oauth app integrations, which is required for adding/using Custom OAuth App Integration like Tableau Cloud for Databricks in AWS cloud.

**Note:** You can only add/use the OAuth custom application integrations when OAuth enrollment status is enabled. For more details see :method:OAuthEnrollment/create

func NewCustomAppIntegration

func NewCustomAppIntegration(client *client.DatabricksClient) *CustomAppIntegrationAPI

func (*CustomAppIntegrationAPI) Create

Create Custom OAuth App Integration.

Create Custom OAuth App Integration.

You can retrieve the custom oauth app integration via :method:get.

func (*CustomAppIntegrationAPI) Delete

Delete Custom OAuth App Integration.

Delete an existing Custom OAuth App Integration. You can retrieve the custom oauth app integration via :method:get.

func (*CustomAppIntegrationAPI) DeleteByIntegrationId

func (a *CustomAppIntegrationAPI) DeleteByIntegrationId(ctx context.Context, integrationId string) error

Delete Custom OAuth App Integration.

Delete an existing Custom OAuth App Integration. You can retrieve the custom oauth app integration via :method:get.

func (*CustomAppIntegrationAPI) Get

Get OAuth Custom App Integration.

Gets the Custom OAuth App Integration for the given integration id.

func (*CustomAppIntegrationAPI) GetByIntegrationId

func (a *CustomAppIntegrationAPI) GetByIntegrationId(ctx context.Context, integrationId string) (*GetCustomAppIntegrationOutput, error)

Get OAuth Custom App Integration.

Gets the Custom OAuth App Integration for the given integration id.

func (*CustomAppIntegrationAPI) Impl

Impl returns low-level CustomAppIntegration API implementation

func (*CustomAppIntegrationAPI) Update

Updates Custom OAuth App Integration.

Updates an existing custom OAuth App Integration. You can retrieve the custom oauth app integration via :method:get.

func (*CustomAppIntegrationAPI) WithImpl

WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks.

type CustomAppIntegrationService

type CustomAppIntegrationService interface {

	// Create Custom OAuth App Integration.
	//
	// Create Custom OAuth App Integration.
	//
	// You can retrieve the custom oauth app integration via :method:get.
	Create(ctx context.Context, request CreateCustomAppIntegration) (*CreateCustomAppIntegrationOutput, error)

	// Delete Custom OAuth App Integration.
	//
	// Delete an existing Custom OAuth App Integration. You can retrieve the
	// custom oauth app integration via :method:get.
	Delete(ctx context.Context, request DeleteCustomAppIntegrationRequest) error

	// Get OAuth Custom App Integration.
	//
	// Gets the Custom OAuth App Integration for the given integration id.
	Get(ctx context.Context, request GetCustomAppIntegrationRequest) (*GetCustomAppIntegrationOutput, error)

	// Updates Custom OAuth App Integration.
	//
	// Updates an existing custom OAuth App Integration. You can retrieve the
	// custom oauth app integration via :method:get.
	Update(ctx context.Context, request UpdateCustomAppIntegration) error
}

These APIs enable administrators to manage custom oauth app integrations, which is required for adding/using Custom OAuth App Integration like Tableau Cloud for Databricks in AWS cloud.

**Note:** You can only add/use the OAuth custom application integrations when OAuth enrollment status is enabled. For more details see :method:OAuthEnrollment/create

type DeleteCustomAppIntegrationRequest

type DeleteCustomAppIntegrationRequest struct {
	// The oauth app integration ID.
	IntegrationId string `json:"-" url:"-"`
}

Delete Custom OAuth App Integration

type DeletePublishedAppIntegrationRequest

type DeletePublishedAppIntegrationRequest struct {
	// The oauth app integration ID.
	IntegrationId string `json:"-" url:"-"`
}

Delete Published OAuth App Integration

type GetCustomAppIntegrationOutput

type GetCustomAppIntegrationOutput struct {
	// oauth client id of the custom oauth app
	ClientId string `json:"client_id,omitempty"`
	// indicates if an oauth client-secret should be generated
	Confidential bool `json:"confidential,omitempty"`
	// name of the custom oauth app
	Name string `json:"name,omitempty"`
	// List of oauth redirect urls
	RedirectUrls []string `json:"redirect_urls,omitempty"`
	// Token access policy
	TokenAccessPolicy *TokenAccessPolicy `json:"token_access_policy,omitempty"`
}

type GetCustomAppIntegrationRequest

type GetCustomAppIntegrationRequest struct {
	// The oauth app integration ID.
	IntegrationId string `json:"-" url:"-"`
}

Get OAuth Custom App Integration

type GetPublishedAppIntegrationOutput

type GetPublishedAppIntegrationOutput struct {
	// app-id of the published app integration
	AppId string `json:"app_id,omitempty"`
	// unique integration id for the published oauth app
	IntegrationId string `json:"integration_id,omitempty"`
	// name of the published oauth app
	Name string `json:"name,omitempty"`
	// Token access policy
	TokenAccessPolicy *TokenAccessPolicy `json:"token_access_policy,omitempty"`
}

type GetPublishedAppIntegrationRequest

type GetPublishedAppIntegrationRequest struct {
	// The oauth app integration ID.
	IntegrationId string `json:"-" url:"-"`
}

Get OAuth Published App Integration

type OAuthEnrollmentAPI

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

These APIs enable administrators to enroll OAuth for their accounts, which is required for adding/using any OAuth published/custom application integration.

**Note:** Your account must be on the E2 version to use these APIs, this is because OAuth is only supported on the E2 version.

func NewOAuthEnrollment

func NewOAuthEnrollment(client *client.DatabricksClient) *OAuthEnrollmentAPI

func (*OAuthEnrollmentAPI) Create

Create OAuth Enrollment request.

Create an OAuth Enrollment request to enroll OAuth for this account and optionally enable the OAuth integration for all the partner applications in the account.

The parter applications are: - Power BI - Tableau Desktop - Databricks CLI

The enrollment is executed asynchronously, so the API will return 204 immediately. The actual enrollment take a few minutes, you can check the status via API :method:get.

func (*OAuthEnrollmentAPI) Get

Get OAuth enrollment status.

Gets the OAuth enrollment status for this Account.

You can only add/use the OAuth published/custom application integrations when OAuth enrollment status is enabled.

func (*OAuthEnrollmentAPI) Impl

Impl returns low-level OAuthEnrollment API implementation

func (*OAuthEnrollmentAPI) WithImpl

WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks.

type OAuthEnrollmentService

type OAuthEnrollmentService interface {

	// Create OAuth Enrollment request.
	//
	// Create an OAuth Enrollment request to enroll OAuth for this account and
	// optionally enable the OAuth integration for all the partner applications
	// in the account.
	//
	// The parter applications are: - Power BI - Tableau Desktop - Databricks
	// CLI
	//
	// The enrollment is executed asynchronously, so the API will return 204
	// immediately. The actual enrollment take a few minutes, you can check the
	// status via API :method:get.
	Create(ctx context.Context, request CreateOAuthEnrollment) error

	// Get OAuth enrollment status.
	//
	// Gets the OAuth enrollment status for this Account.
	//
	// You can only add/use the OAuth published/custom application integrations
	// when OAuth enrollment status is enabled.
	Get(ctx context.Context) (*OAuthEnrollmentStatus, error)
}

These APIs enable administrators to enroll OAuth for their accounts, which is required for adding/using any OAuth published/custom application integration.

**Note:** Your account must be on the E2 version to use these APIs, this is because OAuth is only supported on the E2 version.

type OAuthEnrollmentStatus

type OAuthEnrollmentStatus struct {
	// Is OAuth enrolled for the account.
	IsEnabled bool `json:"is_enabled,omitempty"`
}

type PublishedAppIntegrationAPI

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

These APIs enable administrators to manage published oauth app integrations, which is required for adding/using Published OAuth App Integration like Tableau Cloud for Databricks in AWS cloud.

**Note:** You can only add/use the OAuth published application integrations when OAuth enrollment status is enabled. For more details see :method:OAuthEnrollment/create

func NewPublishedAppIntegration

func NewPublishedAppIntegration(client *client.DatabricksClient) *PublishedAppIntegrationAPI

func (*PublishedAppIntegrationAPI) Create

Create Published OAuth App Integration.

Create Published OAuth App Integration.

You can retrieve the published oauth app integration via :method:get.

func (*PublishedAppIntegrationAPI) Delete

Delete Published OAuth App Integration.

Delete an existing Published OAuth App Integration. You can retrieve the published oauth app integration via :method:get.

func (*PublishedAppIntegrationAPI) DeleteByIntegrationId

func (a *PublishedAppIntegrationAPI) DeleteByIntegrationId(ctx context.Context, integrationId string) error

Delete Published OAuth App Integration.

Delete an existing Published OAuth App Integration. You can retrieve the published oauth app integration via :method:get.

func (*PublishedAppIntegrationAPI) Get

Get OAuth Published App Integration.

Gets the Published OAuth App Integration for the given integration id.

func (*PublishedAppIntegrationAPI) GetByIntegrationId

func (a *PublishedAppIntegrationAPI) GetByIntegrationId(ctx context.Context, integrationId string) (*GetPublishedAppIntegrationOutput, error)

Get OAuth Published App Integration.

Gets the Published OAuth App Integration for the given integration id.

func (*PublishedAppIntegrationAPI) Impl

Impl returns low-level PublishedAppIntegration API implementation

func (*PublishedAppIntegrationAPI) Update

Updates Published OAuth App Integration.

Updates an existing published OAuth App Integration. You can retrieve the published oauth app integration via :method:get.

func (*PublishedAppIntegrationAPI) WithImpl

WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks.

type PublishedAppIntegrationService

type PublishedAppIntegrationService interface {

	// Create Published OAuth App Integration.
	//
	// Create Published OAuth App Integration.
	//
	// You can retrieve the published oauth app integration via :method:get.
	Create(ctx context.Context, request CreatePublishedAppIntegration) (*CreatePublishedAppIntegrationOutput, error)

	// Delete Published OAuth App Integration.
	//
	// Delete an existing Published OAuth App Integration. You can retrieve the
	// published oauth app integration via :method:get.
	Delete(ctx context.Context, request DeletePublishedAppIntegrationRequest) error

	// Get OAuth Published App Integration.
	//
	// Gets the Published OAuth App Integration for the given integration id.
	Get(ctx context.Context, request GetPublishedAppIntegrationRequest) (*GetPublishedAppIntegrationOutput, error)

	// Updates Published OAuth App Integration.
	//
	// Updates an existing published OAuth App Integration. You can retrieve the
	// published oauth app integration via :method:get.
	Update(ctx context.Context, request UpdatePublishedAppIntegration) error
}

These APIs enable administrators to manage published oauth app integrations, which is required for adding/using Published OAuth App Integration like Tableau Cloud for Databricks in AWS cloud.

**Note:** You can only add/use the OAuth published application integrations when OAuth enrollment status is enabled. For more details see :method:OAuthEnrollment/create

type TokenAccessPolicy

type TokenAccessPolicy struct {
	// access token time to live in minutes
	AccessTokenTtlInMinutes any `json:"access_token_ttl_in_minutes,omitempty"`
	// refresh token time to live in minutes
	RefreshTokenTtlInMinutes any `json:"refresh_token_ttl_in_minutes,omitempty"`
}

type UpdateCustomAppIntegration

type UpdateCustomAppIntegration struct {
	// The oauth app integration ID.
	IntegrationId string `json:"-" url:"-"`
	// List of oauth redirect urls to be updated in the custom oauth app
	// integration
	RedirectUrls []string `json:"redirect_urls,omitempty"`
	// Token access policy to be updated in the custom oauth app integration
	TokenAccessPolicy *TokenAccessPolicy `json:"token_access_policy,omitempty"`
}

type UpdatePublishedAppIntegration

type UpdatePublishedAppIntegration struct {
	// The oauth app integration ID.
	IntegrationId string `json:"-" url:"-"`
	// Token access policy to be updated in the published oauth app integration
	TokenAccessPolicy *TokenAccessPolicy `json:"token_access_policy,omitempty"`
}

Jump to

Keyboard shortcuts

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