orgs

package
v0.19.1296 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseClaimConditions added in v0.19.1101

func ParseClaimConditions(raw []string) (map[string]string, error)

ParseClaimConditions parses repeated `claim=pattern` flag values.

Types

type Service

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

func New

func New(apiClient nuon.Client, cfg *config.Config) *Service

func (*Service) APIToken

func (s *Service) APIToken(ctx context.Context, asJSON bool) error

func (*Service) ConnectGithub

func (s *Service) ConnectGithub(ctx context.Context) error

func (*Service) Create

func (s *Service) Create(ctx context.Context, name string, isSandboxMode, noselect bool, asJSON bool) error

func (*Service) CreateChannelSubscription added in v0.19.1197

func (s *Service) CreateChannelSubscription(
	ctx context.Context,
	channelID, channelName, orgLinkID string,
	subscription SubscriptionFlags,
	asJSON bool,
) error

CreateChannelSubscription resolves orgLinkID to the org's single linked Slack workspace when empty; with multiple links, the caller must disambiguate.

func (*Service) CreateInvite

func (s *Service) CreateInvite(ctx context.Context, email, role string, asJSON bool) error

func (*Service) CreateOIDCTrustPolicy added in v0.19.1101

func (s *Service) CreateOIDCTrustPolicy(ctx context.Context, name, issuer, audience, role string, ttl int64, conditions map[string]string, asJSON bool) error

func (*Service) CreateStaticToken added in v0.19.1073

func (s *Service) CreateStaticToken(ctx context.Context, name, duration, role string, personal, asJSON bool) error

func (*Service) CreateWebhook added in v0.19.901

func (s *Service) CreateWebhook(ctx context.Context, webhookURL, webhookSecret string, subscription SubscriptionFlags, asJSON bool) error

func (*Service) Current

func (s *Service) Current(ctx context.Context, asJSON bool) error

func (*Service) DeleteChannelSubscription added in v0.19.1197

func (s *Service) DeleteChannelSubscription(ctx context.Context, subID string, asJSON bool) error

func (*Service) DeleteOIDCTrustPolicy added in v0.19.1101

func (s *Service) DeleteOIDCTrustPolicy(ctx context.Context, policyID string, asJSON bool) error

func (*Service) DeleteStaticToken added in v0.19.1073

func (s *Service) DeleteStaticToken(ctx context.Context, tokenID string, asJSON bool) error

func (*Service) DeleteVCSConnection

func (s *Service) DeleteVCSConnection(ctx context.Context, connID string, asJSON bool) error

func (*Service) DeleteWebhook added in v0.19.901

func (s *Service) DeleteWebhook(ctx context.Context, webhookID string, asJSON bool) error

func (*Service) Deselect

func (s *Service) Deselect(ctx context.Context) error

func (*Service) GetOIDCTrustPolicy added in v0.19.1101

func (s *Service) GetOIDCTrustPolicy(ctx context.Context, policyID string, asJSON bool) error

func (*Service) ID

func (s *Service) ID(ctx context.Context, asJSON bool) error

func (*Service) List

func (s *Service) List(ctx context.Context, offset, limit int, search string, asJSON bool) error

func (*Service) ListChannelSubscriptions added in v0.19.1197

func (s *Service) ListChannelSubscriptions(ctx context.Context, asJSON bool) error

func (*Service) ListInvites

func (s *Service) ListInvites(ctx context.Context, offset, limit int, asJSON bool) error

func (*Service) ListOIDCTrustPolicies added in v0.19.1101

func (s *Service) ListOIDCTrustPolicies(ctx context.Context, asJSON bool) error

func (*Service) ListStaticTokens added in v0.19.1073

func (s *Service) ListStaticTokens(ctx context.Context, asJSON bool) error

func (*Service) ListWebhooks added in v0.19.901

func (s *Service) ListWebhooks(ctx context.Context, asJSON bool) error

func (*Service) PrintConfig

func (s *Service) PrintConfig(asJSON bool) error

func (*Service) Select

func (s *Service) Select(ctx context.Context, orgID string, offset, limit int, asJSON bool) error

func (*Service) SetCurrent

func (s *Service) SetCurrent(ctx context.Context, orgID string, asJSON bool)

func (*Service) UpdateChannelSubscription added in v0.19.1197

func (s *Service) UpdateChannelSubscription(
	ctx context.Context,
	subID string,
	subscription SubscriptionFlags,
	asJSON bool,
) error

UpdateChannelSubscription is a partial update: keys omitted from the patch leave the stored value untouched, and "match": null resets the scope to org-wide. The TUI picker is intentionally not wired here — it writes one resource kind at a time and never pre-loads the existing subscription, so multi-kind matches would be silently destroyed; JSON is the only lossless way to express them.

func (*Service) UpdateOIDCTrustPolicy added in v0.19.1101

func (s *Service) UpdateOIDCTrustPolicy(ctx context.Context, policyID string, req *models.ServiceUpdateOIDCTrustPolicyRequest, asJSON bool) error

func (*Service) UpdateUserRole added in v0.19.1075

func (s *Service) UpdateUserRole(ctx context.Context, userID, role string, asJSON bool) error

func (*Service) UpdateWebhook added in v0.19.915

func (s *Service) UpdateWebhook(
	ctx context.Context,
	webhookID, webhookSecret string,
	subscription SubscriptionFlags,
	asJSON bool,
) error

UpdateWebhook calls PATCH /v1/orgs/current/webhooks/{webhook_id} to replace the webhook subscription (interests + match) and optionally rotate the signing secret.

The interests filter and match predicate are replaced wholesale every call: omitting --subscription-json / --subscription-file resets the webhook to the implicit default (every event in the org, no scoping).

When webhookSecret is empty, the existing secret is left unchanged. When non-empty, the API replaces the stored secret with the provided value. Removing a secret entirely (delivering payloads unsigned) is intentionally not exposed by the CLI — the SDK's swagger model serializes the field with omitempty so an empty string cannot be transmitted; use the dashboard for that case.

func (*Service) VCSConnections

func (s *Service) VCSConnections(ctx context.Context, offset, limit int, asJSON bool) error

type SubscriptionFlags added in v0.19.927

type SubscriptionFlags struct {
	JSON string
	File string
}

SubscriptionFlags collects the CLI flags shared by `webhooks create` and `webhooks update` describing the full webhook subscription — both the interests filter (which events fire) and the optional match predicate (which entities are in scope).

Exactly one of (--subscription-json, --subscription-file) may be set. When neither is set, Resolve returns the implicit default: subscribe to every event in the org (interests = {"all_events": true}, match = nil).

func (SubscriptionFlags) Resolve added in v0.19.927

Resolve turns the raw flag values into the parsed subscription payload the request builders pass into the SDK.

  • --subscription-file path : reads JSON from disk
  • --subscription-json '{…}': parses inline JSON
  • neither : defaults to AllEvents + org-wide

The JSON shape is `{"interests": {...}, "match": {...}}` — both keys optional. A missing "interests" defaults to {"all_events": true} so the caller can scope a webhook with `--subscription-json '{"match":{...}}'` without restating the events filter.

type SubscriptionPayload added in v0.19.927

type SubscriptionPayload struct {
	Interests any                       `json:"interests"`
	Match     *labels.SubscriptionMatch `json:"match"`
}

SubscriptionPayload is the parsed shape of the unified subscription file or inline JSON. Both fields are optional. The wire types are deliberately `any` so the CLI is agnostic to the server's internal Interests struct (which lives in services/ctl-api/internal/pkg/interests and is not part of the public SDK).

Match is a *labels.SubscriptionMatch so we can run client-side Validate() before paying for an HTTP round-trip; a nil pointer (or omitted "match" key) preserves the legacy "match every event in the org" semantics.

Directories

Path Synopsis
pickers.go houses the data-driven entity pickers that fire after the main subscription form (tui.go) when the user selects "specific" for a given kind.
pickers.go houses the data-driven entity pickers that fire after the main subscription form (tui.go) when the user selects "specific" for a given kind.

Jump to

Keyboard shortcuts

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