applications

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2025 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const CollectionName = "applications"

Variables

View Source
var CreateApplicationDef = types.ToolDefinition{
	McpTool: &mcp.Tool{
		Name:         "create_oidc_application",
		Title:        "Create PingOne OIDC Application",
		Description:  "Create a new OIDC application within a specified PingOne environment.",
		InputSchema:  schema.MustGenerateSchema[CreateApplicationInput](),
		OutputSchema: schema.MustGenerateSchema[CreateApplicationOutput](),
		Annotations: &mcp.ToolAnnotations{
			DestructiveHint: func() *bool { b := false; return &b }(),
		},
	},
}
View Source
var GetApplicationDef = types.ToolDefinition{
	ValidationPolicy: &types.ToolValidationPolicy{
		AllowProductionEnvironmentRead: true,
	},
	McpTool: &mcp.Tool{
		Name:        "get_application",
		Title:       "Get PingOne Application by ID",
		Description: "Retrieve application configuration by ID. Use 'list_applications' first if you need to find the application ID. Call before 'update_oidc_application' to get current settings.",
		InputSchema: schema.MustGenerateSchema[GetApplicationInput](),
		Annotations: &mcp.ToolAnnotations{
			ReadOnlyHint: true,
		},
	},
}
View Source
var ListApplicationsDef = types.ToolDefinition{
	ValidationPolicy: &types.ToolValidationPolicy{
		AllowProductionEnvironmentRead: true,
	},
	McpTool: &mcp.Tool{
		Name:         "list_applications",
		Title:        "List PingOne Applications",
		Description:  "Lists all applications in an environment. Use to discover application IDs or review configurations before updates. Returns OIDC, SAML, External Link, and PingOne system applications.",
		InputSchema:  schema.MustGenerateSchema[ListApplicationsInput](),
		OutputSchema: schema.MustGenerateSchema[ListApplicationsOutput](),
		Annotations: &mcp.ToolAnnotations{
			ReadOnlyHint: true,
		},
	},
}
View Source
var UpdateApplicationDef = types.ToolDefinition{
	McpTool: &mcp.Tool{
		Name:  "update_oidc_application",
		Title: "Update PingOne OIDC Application by ID",
		Description: `Update OIDC application configuration using full replacement (HTTP PUT).

WORKFLOW - Required to avoid data loss:
1. Call 'get_application' to fetch current configuration
2. Modify only the fields you want to change
3. Pass the complete merged object to this tool

Omitted optional fields will be cleared.`,
		InputSchema:  schema.MustGenerateSchema[UpdateApplicationInput](),
		OutputSchema: schema.MustGenerateSchema[UpdateApplicationOutput](),
	},
}

Functions

func CreateApplicationHandler

func CreateApplicationHandler(applicationsClientFactory ApplicationsClientFactory, initializeAuthContext initialize.ContextInitializer) func(
	ctx context.Context,
	req *mcp.CallToolRequest,
	input CreateApplicationInput,
) (
	*mcp.CallToolResult,
	*CreateApplicationOutput,
	error,
)

CreateApplicationHandler creates a new PingOne application using the provided client

func GetApplicationHandler

func GetApplicationHandler(applicationsClientFactory ApplicationsClientFactory, initializeAuthContext initialize.ContextInitializer) func(
	ctx context.Context,
	req *mcp.CallToolRequest,
	input GetApplicationInput,
) (
	*mcp.CallToolResult,
	any,
	error,
)

GetApplicationHandler retrieves a PingOne application by ID using the provided client

func ListApplicationsHandler

func ListApplicationsHandler(clientFactory ApplicationsClientFactory, initializeAuthContext initialize.ContextInitializer) func(
	ctx context.Context,
	req *mcp.CallToolRequest,
	input ListApplicationsInput,
) (
	*mcp.CallToolResult,
	*ListApplicationsOutput,
	error,
)

ListApplicationsHandler lists all PingOne applications using the provided client

func UpdateApplicationHandler

func UpdateApplicationHandler(applicationsClientFactory ApplicationsClientFactory, initializeAuthContext initialize.ContextInitializer) func(
	ctx context.Context,
	req *mcp.CallToolRequest,
	input UpdateApplicationInput,
) (
	*mcp.CallToolResult,
	*UpdateApplicationOutput,
	error,
)

Types

type ApplicationSummary

type ApplicationSummary struct {
	Id        *string                             `json:"id,omitempty" jsonschema:"The UUID of the application"`
	Name      string                              `json:"name" jsonschema:"The name of the application"`
	Protocol  *management.EnumApplicationProtocol `json:"protocol,omitempty" jsonschema:"The protocol type of the application"`
	Type      *management.EnumApplicationType     `json:"type,omitempty" jsonschema:"The type of the application"`
	CreatedAt *time.Time                          `json:"createdAt,omitempty" jsonschema:"The creation timestamp of the application"`
}

type ApplicationsClient

type ApplicationsClient interface {
	GetApplications(ctx context.Context, environmentId uuid.UUID) (management.EntityArrayPagedIterator, error)
	CreateApplication(ctx context.Context, environmentId uuid.UUID, app management.CreateApplicationRequest) (*management.CreateApplication201Response, *http.Response, error)
	GetApplication(ctx context.Context, environmentId uuid.UUID, applicationId uuid.UUID) (*management.ReadOneApplication200Response, *http.Response, error)
	UpdateApplication(ctx context.Context, environmentId uuid.UUID, applicationId uuid.UUID, app management.UpdateApplicationRequest) (*management.ReadOneApplication200Response, *http.Response, error)
}

type ApplicationsClientFactory

type ApplicationsClientFactory interface {
	GetAuthenticatedClient(ctx context.Context) (ApplicationsClient, error)
}

type ApplicationsCollection

type ApplicationsCollection struct{}

func (*ApplicationsCollection) ListTools

func (c *ApplicationsCollection) ListTools() []types.ToolDefinition

func (*ApplicationsCollection) Name

func (c *ApplicationsCollection) Name() string

func (*ApplicationsCollection) RegisterTools

func (c *ApplicationsCollection) RegisterTools(ctx context.Context, server *mcp.Server, clientFactory legacy.ClientFactory, authClientFactory client.AuthClientFactory, tokenStore tokenstore.TokenStore, toolFilter *filter.Filter, grantType auth.GrantType) error

type CreateApplicationInput

type CreateApplicationInput struct {
	EnvironmentId uuid.UUID                  `json:"environmentId" jsonschema:"REQUIRED. Environment UUID."`
	Application   management.ApplicationOIDC `json:"application" jsonschema:"REQUIRED. The OIDC application configuration details"`
}

type CreateApplicationOutput

type CreateApplicationOutput struct {
	Application management.ApplicationOIDC `json:"application" jsonschema:"The created application details"`
}

type GetApplicationInput

type GetApplicationInput struct {
	EnvironmentId uuid.UUID `json:"environmentId" jsonschema:"REQUIRED. The unique identifier (UUID) string of the PingOne environment"`
	ApplicationId uuid.UUID `json:"applicationId" jsonschema:"REQUIRED. The unique identifier (UUID) string of the PingOne application"`
}

type ListApplicationsInput

type ListApplicationsInput struct {
	EnvironmentId uuid.UUID `json:"environmentId" jsonschema:"REQUIRED. Environment UUID."`
}

type ListApplicationsOutput

type ListApplicationsOutput struct {
	Applications []ApplicationSummary `json:"applications" jsonschema:"List of applications with their configuration details"`
}

type PingOneClientApplicationsWrapper

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

func NewPingOneClientApplicationsWrapper

func NewPingOneClientApplicationsWrapper(client *pingone.Client) *PingOneClientApplicationsWrapper

func (*PingOneClientApplicationsWrapper) CreateApplication

func (*PingOneClientApplicationsWrapper) GetApplication

func (p *PingOneClientApplicationsWrapper) GetApplication(ctx context.Context, environmentId uuid.UUID, applicationId uuid.UUID) (*management.ReadOneApplication200Response, *http.Response, error)

func (*PingOneClientApplicationsWrapper) GetApplications

func (*PingOneClientApplicationsWrapper) UpdateApplication

type PingOneClientApplicationsWrapperFactory

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

func NewPingOneClientApplicationsWrapperFactory

func NewPingOneClientApplicationsWrapperFactory(clientFactory legacy.ClientFactory, tokenStore tokenstore.TokenStore) *PingOneClientApplicationsWrapperFactory

func (*PingOneClientApplicationsWrapperFactory) GetAuthenticatedClient

type UpdateApplicationInput

type UpdateApplicationInput struct {
	EnvironmentId uuid.UUID                  `json:"environmentId" jsonschema:"REQUIRED. Environment UUID."`
	ApplicationId uuid.UUID                  `json:"applicationId" jsonschema:"REQUIRED. Application UUID."`
	Application   management.ApplicationOIDC `json:"application" jsonschema:"REQUIRED. The complete OIDC application config with modifications."`
}

type UpdateApplicationOutput

type UpdateApplicationOutput struct {
	Application management.ApplicationOIDC `json:"application" jsonschema:"The updated application configuration details"`
}

Jump to

Keyboard shortcuts

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