handler

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: Apache-2.0 Imports: 32 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"
	LabelAppIdHash                    = "sme.sap.com/app-identifier-hash"
	LabelTenantId                     = "sme.sap.com/btp-tenant-id"
	LabelTenantType                   = "sme.sap.com/tenant-type"
	LabelSubscriptionGUID             = "sme.sap.com/subscription-guid"
)
View Source
const (
	ResourceCreated  = "resource created successfully"
	ResourceUpdated  = "resource updated successfully"
	ResourceFound    = "resource exists"
	ResourceDeleted  = "resource deleted successfully"
	ResourceNotFound = "resource not found"
	TenantNotFound   = "tenant not found"
)
View Source
const (
	CallbackSucceeded              = "SUCCEEDED"
	CallbackFailed                 = "FAILED"
	ProvisioningSucceededMessage   = "Provisioning successful"
	ProvisioningFailedMessage      = "Provisioning failed"
	DeprovisioningSucceededMessage = "Deprovisioning successful"
	DeprovisioningFailedMessage    = "Deprovisioning failed"
)
View Source
const (
	Step                 = "step"
	TenantProvisioning   = "Tenant Provisioning"
	TenantDeprovisioning = "Tenant Deprovisioning"
)
View Source
const (
	SaaS subscriptionType = "SaaS"
	SMS  subscriptionType = "SMS"
)
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 CallbackReqInfo added in v0.20.0

type CallbackReqInfo struct {
	util.CredentialData
	CallbackTimeoutMillis string
	CallbackUrl           string
	CallbackPath          string
	SubscriptionType      subscriptionType
}

type JsonDN added in v0.20.0

type JsonDN struct {
	C  stringslice `json:"C"`
	O  stringslice `json:"O"`
	OU stringslice `json:"OU"`
	L  stringslice `json:"L"`
	CN string      `json:"CN"`
}

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 RequestInfo added in v0.20.0

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

func ProcessRequest added in v0.20.0

func ProcessRequest(req *http.Request, subscriptionType subscriptionType) (*RequestInfo, error)

type Result

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

type SaaSCallbackResponse added in v0.20.0

type SaaSCallbackResponse struct {
	SubscriptionUrl string `json:"subscriptionUrl"`
	// contains filtered or unexported fields
}

type SmsCallbackResponse added in v0.20.0

type SmsCallbackResponse struct {
	ApplicationUrl string `json:"applicationUrl"`
	// contains filtered or unexported fields
}

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(reqInfo *RequestInfo) *Result

func (*SubscriptionHandler) DeleteTenant

func (s *SubscriptionHandler) DeleteTenant(reqInfo *RequestInfo) *Result

func (*SubscriptionHandler) HandleRequest

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

func (*SubscriptionHandler) HandleSMSRequest added in v0.20.0

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

func (*SubscriptionHandler) HandleSaaSRequest added in v0.20.0

func (s *SubscriptionHandler) HandleSaaSRequest(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
	// at least one expected scope must be fulfilled
	ExpectedScopes []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