handler

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnnotationSubscriptionContextSecret = "sme.sap.com/subscription-context-secret"
	AnnotationSaaSAdditionalOutput      = "sme.sap.com/saas-additional-output"
	AnnotationSubscriptionDomain        = "sme.sap.com/subscription-domain"
)
View Source
const (
	LabelBTPApplicationIdentifierHash = "sme.sap.com/btp-app-identifier-hash"
	LabelTenantId                     = "sme.sap.com/btp-tenant-id"
)
View Source
const (
	ResourceCreated  = "resource created successfully"
	ResourceFound    = "resource exists"
	ResourceDeleted  = "resource deleted successfully"
	ResourceNotFound = "resource not found"
)
View Source
const (
	CallbackSucceeded              = "SUCCEEDED"
	CallbackFailed                 = "FAILED"
	ProvisioningSucceededMessage   = "Provisioning successful"
	ProvisioningFailedMessage      = "Provisioning failed"
	DeprovisioningSucceededMessage = "Deprovisioning successful"
	DeprovisioningFailedMessage    = "Deprovisioning failed"
)
View Source
const AuthorizationCheckFailed = "authorization check failed"
View Source
const BasicPrefix = "Basic "
View Source
const BearerPrefix = "Bearer "
View Source
const ErrorOccurred = "Error occurred "
View Source
const InvalidRequestMethod = "invalid request method"

Variables

This section is empty.

Functions

func VerifyXSUAAJWTToken

func VerifyXSUAAJWTToken(ctx context.Context, tokenString string, config *XSUAAConfig, client *http.Client) error

token validation for XSUAA token implemented by following the guidelines provided -> CPSecurity/Knowledge-Base/03_ApplicationSecurity/TokenValidation/

Types

type CallbackResponse

type CallbackResponse struct {
	Status           string          `json:"status"`
	Message          string          `json:"message"`
	SubscriptionUrl  string          `json:"subscriptionUrl"`
	AdditionalOutput *map[string]any `json:"additionalOutput,omitempty"`
}

type OAuthResponse

type OAuthResponse struct {
	AccessToken string `json:"access_token"`
}

type OpenIDConfig

type OpenIDConfig struct {
	JWKSURI                    string   `json:"jwks_uri"`
	SigningAlgorithmsSupported []string `json:"token_endpoint_auth_signing_alg_values_supported"`
	ClaimsSupported            []string `json:"claims_supported"`
}

type Result

type Result struct {
	Tenant  *v1alpha1.CAPTenant
	Message string
}

type SubscriptionHandler

type SubscriptionHandler struct {
	Clientset    versioned.Interface
	KubeClienset kubernetes.Interface
	// contains filtered or unexported fields
}

func NewSubscriptionHandler

func NewSubscriptionHandler(clientset versioned.Interface, kubeClienset kubernetes.Interface) *SubscriptionHandler

func (*SubscriptionHandler) CreateTenant

func (s *SubscriptionHandler) CreateTenant(req *http.Request) *Result

func (*SubscriptionHandler) DeleteTenant

func (s *SubscriptionHandler) DeleteTenant(req *http.Request) *Result

func (*SubscriptionHandler) HandleRequest

func (s *SubscriptionHandler) HandleRequest(w http.ResponseWriter, req *http.Request)

type XSUAAConfig

type XSUAAConfig struct {
	UAADomain string
	// one of xsappname OR clientid must be part of the audience
	XSAppName string
	ClientID  string
	// all requested scopes must be fulfilled
	RequiredScopes []string
}

type XSUAAJWTClaims

type XSUAAJWTClaims struct {
	Scope                []string `json:"scope"`
	ClientID             string   `json:"client_id"`
	AuthorizedParty      string   `json:"azp"`
	jwt.RegisteredClaims `json:",inline"`
}

Jump to

Keyboard shortcuts

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