Help us shape the future of Go! Take the 2026 Go Developer Survey

webhook

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MPL-2.0 Imports: 35 Imported by: 0

Documentation

Overview

Package webhook implements the jamfplatform_pro_webhook resource, data source, and list resource backed by the Jamf ProClassic /webhooks API. The construct name mirrors the Jamf Pro admin UI ("Webhooks" under Settings → Global). The wire envelope is flat (no <general> wrapper). See WEBHOOK_SPIKE.md for the wire-probe behind every field, enum, and validator.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWebhookDataSource

func NewWebhookDataSource() datasource.DataSource

NewWebhookDataSource returns a new instance of WebhookDataSource.

func NewWebhookListResource

func NewWebhookListResource() list.ListResource

NewWebhookListResource returns a list resource for Jamf Pro webhook queries.

func NewWebhookResource

func NewWebhookResource() resource.Resource

NewWebhookResource returns a new instance of WebhookResource.

Types

type WebhookDataSource

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

WebhookDataSource implements the Terraform data source for Jamf Pro webhooks. Lookup is by ID or by exact name — exactly one must be supplied. `password` is not surfaced (the server redacts it).

func (*WebhookDataSource) ConfigValidators

func (d *WebhookDataSource) ConfigValidators(ctx context.Context) []datasource.ConfigValidator

ConfigValidators enforces that exactly one of id / name is supplied.

func (*WebhookDataSource) Configure

Configure wires the Jamf ProClassic client into the data source.

func (*WebhookDataSource) Metadata

Metadata sets the data source type name.

func (*WebhookDataSource) Read

Read fetches a record by ID or by name and populates Terraform state.

func (*WebhookDataSource) Schema

Schema returns the data source schema.

type WebhookDataSourceModel

type WebhookDataSourceModel struct {
	ID                                types.String             `tfsdk:"id"`
	Name                              types.String             `tfsdk:"name"`
	Enabled                           types.Bool               `tfsdk:"enabled"`
	URL                               types.String             `tfsdk:"url"`
	AuthenticationType                types.String             `tfsdk:"authentication_type"`
	ConnectionTimeout                 types.Int64              `tfsdk:"connection_timeout"`
	ReadTimeout                       types.Int64              `tfsdk:"read_timeout"`
	ContentType                       types.String             `tfsdk:"content_type"`
	Event                             types.String             `tfsdk:"event"`
	Username                          types.String             `tfsdk:"username"`
	Header                            types.String             `tfsdk:"header"`
	HashAlgorithm                     types.String             `tfsdk:"hash_algorithm"`
	SmartGroupID                      types.Int64              `tfsdk:"smart_group_id"`
	EnableDisplayFieldsForGroupObject types.Bool               `tfsdk:"enable_display_fields_for_group_object"`
	DisplayFields                     types.Set                `tfsdk:"display_fields"`
	Timeouts                          datasourceTimeouts.Value `tfsdk:"timeouts"`
}

WebhookDataSourceModel is the flat read-only data source projection. Selects by `id` or exact `name` (ExactlyOneOf). `password` is omitted (the server redacts it); `header` is surfaced as Sensitive since the server echoes it.

type WebhookListResource

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

WebhookListResource implements Terraform query list support for Jamf Pro webhooks. Classic /webhooks has no RSQL — the optional `filter` block is applied client-side via filters.ApplyClassicFilter. List items carry only id + name on the wire, so when IncludeResource is requested (config generation) each webhook is fetched individually and hydrated through the shared Read state-builder — matching the resource's import fidelity.

func (*WebhookListResource) Configure

Configure wires the Jamf ProClassic client into the list resource.

func (*WebhookListResource) List

List executes the query and streams record identities back to Terraform.

func (*WebhookListResource) ListResourceConfigSchema

ListResourceConfigSchema describes the supported list filters.

func (*WebhookListResource) Metadata

Metadata sets the list resource type name.

type WebhookListResourceModel

type WebhookListResourceModel struct {
	Filter   *filters.ClassicFilterModel `tfsdk:"filter"`
	Timeouts listtimeouts.Value          `tfsdk:"timeouts"`
}

WebhookListResourceModel represents the config model for list queries. Classic /webhooks has no RSQL — the filter shape is the shared client-side substring block.

type WebhookResource

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

WebhookResource implements the Terraform resource for Jamf Pro webhooks.

func (*WebhookResource) ConfigValidators

func (r *WebhookResource) ConfigValidators(ctx context.Context) []resource.ConfigValidator

ConfigValidators returns the plan-time cross-field validators.

func (*WebhookResource) Configure

Configure wires the Jamf ProClassic client into the resource.

func (*WebhookResource) Create

Create creates a new Jamf Pro webhook. Classic POSTs to id="0"; the server allocates the real integer ID and returns it.

func (*WebhookResource) Delete

Delete removes a Jamf Pro webhook.

func (*WebhookResource) IdentitySchema

IdentitySchema defines the identifier used for import and list results.

func (*WebhookResource) ImportState

ImportState handles import by the Jamf Pro webhook ID.

func (*WebhookResource) Metadata

Metadata sets the resource type name.

func (*WebhookResource) ModifyPlan added in v1.7.0

ModifyPlan reports a webhook name that another webhook already holds.

func (*WebhookResource) Read

Read refreshes Terraform state with the latest record representation.

func (*WebhookResource) Schema

Schema returns the Terraform schema. Attribute names mirror the Jamf Pro admin UI labels (STYLE_GUIDE §Attribute names mirror the admin UI).

func (*WebhookResource) Update

Update updates a Jamf Pro webhook. Classic UpdateWebhookByID returns 201 with an empty body — we must GET to refresh state.

type WebhookResourceModel

type WebhookResourceModel struct {
	ID                                types.String           `tfsdk:"id"`
	Name                              types.String           `tfsdk:"name"`
	Enabled                           types.Bool             `tfsdk:"enabled"`
	URL                               types.String           `tfsdk:"url"`
	AuthenticationType                types.String           `tfsdk:"authentication_type"`
	ConnectionTimeout                 types.Int64            `tfsdk:"connection_timeout"`
	ReadTimeout                       types.Int64            `tfsdk:"read_timeout"`
	ContentType                       types.String           `tfsdk:"content_type"`
	Event                             types.String           `tfsdk:"event"`
	Username                          types.String           `tfsdk:"username"`
	Password                          types.String           `tfsdk:"password"`
	PasswordWoVersion                 types.Int64            `tfsdk:"password_wo_version"`
	Header                            types.String           `tfsdk:"header"`
	HashAlgorithm                     types.String           `tfsdk:"hash_algorithm"`
	SmartGroupID                      types.Int64            `tfsdk:"smart_group_id"`
	EnableDisplayFieldsForGroupObject types.Bool             `tfsdk:"enable_display_fields_for_group_object"`
	DisplayFields                     types.Set              `tfsdk:"display_fields"`
	Timeouts                          resourceTimeouts.Value `tfsdk:"timeouts"`
}

WebhookResourceModel is the Terraform resource model for a Jamf Pro webhook (the classic /webhooks endpoint). The wire envelope is flat — every field is top-level, there is no <general> wrapper — plus one Computed-only display_fields reflection. See WEBHOOK_SPIKE.md for the full wire-probe.

  • `Password` is `WriteOnly`: the plaintext (BASIC password or HASH_SIGNATURE signing secret) is sent on writes but never persisted in state. `PasswordWoVersion` is the rotation trigger — bump it to force the next Update to re-send the current `Password`.
  • `Header` (HEADER auth, JSON) is Sensitive but state-tracked: the server echoes it back faithfully, so tracking it in state enables drift detection (unlike `Password`, which the server redacts).
  • `DisplayFields` is Computed-only — the classic API rejects any populated <display_field> (409 "Problem with display_fields"); only the `EnableDisplayFieldsForGroupObject` bool is writable.

Jump to

Keyboard shortcuts

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