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 ¶
- func NewWebhookDataSource() datasource.DataSource
- func NewWebhookListResource() list.ListResource
- func NewWebhookResource() resource.Resource
- type WebhookDataSource
- func (d *WebhookDataSource) ConfigValidators(ctx context.Context) []datasource.ConfigValidator
- func (d *WebhookDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, ...)
- func (d *WebhookDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, ...)
- func (d *WebhookDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse)
- func (d *WebhookDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, ...)
- type WebhookDataSourceModel
- type WebhookListResource
- func (r *WebhookListResource) Configure(ctx context.Context, req resource.ConfigureRequest, ...)
- func (r *WebhookListResource) List(ctx context.Context, req list.ListRequest, stream *list.ListResultsStream)
- func (r *WebhookListResource) ListResourceConfigSchema(ctx context.Context, req list.ListResourceSchemaRequest, ...)
- func (r *WebhookListResource) Metadata(ctx context.Context, req resource.MetadataRequest, ...)
- type WebhookListResourceModel
- type WebhookResource
- func (r *WebhookResource) ConfigValidators(ctx context.Context) []resource.ConfigValidator
- func (r *WebhookResource) Configure(ctx context.Context, req resource.ConfigureRequest, ...)
- func (r *WebhookResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r *WebhookResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
- func (r *WebhookResource) IdentitySchema(ctx context.Context, req resource.IdentitySchemaRequest, ...)
- func (r *WebhookResource) ImportState(ctx context.Context, req resource.ImportStateRequest, ...)
- func (r *WebhookResource) Metadata(ctx context.Context, req resource.MetadataRequest, ...)
- func (r *WebhookResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, ...)
- func (r *WebhookResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (r *WebhookResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
- func (r *WebhookResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
- type WebhookResourceModel
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 ¶
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 ¶
func (d *WebhookDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse)
Configure wires the Jamf ProClassic client into the data source.
func (*WebhookDataSource) Metadata ¶
func (d *WebhookDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse)
Metadata sets the data source type name.
func (*WebhookDataSource) Read ¶
func (d *WebhookDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse)
Read fetches a record by ID or by name and populates Terraform state.
func (*WebhookDataSource) Schema ¶
func (d *WebhookDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse)
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 ¶
func (r *WebhookListResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
Configure wires the Jamf ProClassic client into the list resource.
func (*WebhookListResource) List ¶
func (r *WebhookListResource) List(ctx context.Context, req list.ListRequest, stream *list.ListResultsStream)
List executes the query and streams record identities back to Terraform.
func (*WebhookListResource) ListResourceConfigSchema ¶
func (r *WebhookListResource) ListResourceConfigSchema(ctx context.Context, req list.ListResourceSchemaRequest, resp *list.ListResourceSchemaResponse)
ListResourceConfigSchema describes the supported list filters.
func (*WebhookListResource) Metadata ¶
func (r *WebhookListResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
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 ¶
func (r *WebhookResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
Configure wires the Jamf ProClassic client into the resource.
func (*WebhookResource) Create ¶
func (r *WebhookResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
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 ¶
func (r *WebhookResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
Delete removes a Jamf Pro webhook.
func (*WebhookResource) IdentitySchema ¶
func (r *WebhookResource) IdentitySchema(ctx context.Context, req resource.IdentitySchemaRequest, resp *resource.IdentitySchemaResponse)
IdentitySchema defines the identifier used for import and list results.
func (*WebhookResource) ImportState ¶
func (r *WebhookResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse)
ImportState handles import by the Jamf Pro webhook ID.
func (*WebhookResource) Metadata ¶
func (r *WebhookResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
Metadata sets the resource type name.
func (*WebhookResource) ModifyPlan ¶ added in v1.7.0
func (r *WebhookResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse)
ModifyPlan reports a webhook name that another webhook already holds.
func (*WebhookResource) Read ¶
func (r *WebhookResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
Read refreshes Terraform state with the latest record representation.
func (*WebhookResource) Schema ¶
func (r *WebhookResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
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 ¶
func (r *WebhookResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
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.