1
0
Fork 0
mirror of synced 2026-12-06 18:52:25 +00:00
No description
  • Go 96.6%
  • Go Template 1.7%
  • Shell 1%
  • Makefile 0.7%
Find a file
Parker Wahle 02015f115d
ci: refuse to auto-merge while main requires no checks
gh pr merge --auto merges a pull request at once when its branch requires
no checks, which is how parkerwahle's Dependabot updates merged unchecked
while it was private. The auto-merge job now fails instead, reading the
required checks from the branch endpoint with the workflow's own token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mv4cZ26P29Ps7uxs6icRu2
2026-11-24 20:13:55 -05:00
.github ci: refuse to auto-merge while main requires no checks 2026-11-24 20:13:55 -05:00
docs fix: match what OneSignal's API does live 2026-11-16 21:14:32 -05:00
examples fix: match what OneSignal's API does live 2026-11-16 21:14:32 -05:00
internal test: live tests against a OneSignal app 2026-11-16 21:14:33 -05:00
templates docs: generate docs/ from the schema OpenTofu reports 2026-11-16 20:32:59 -05:00
tools docs: generate docs/ from the schema OpenTofu reports 2026-11-16 20:32:59 -05:00
.gitignore Initial commit 2026-11-16 20:10:42 -05:00
.golangci.yml Initial commit 2026-11-16 20:10:42 -05:00
CHANGELOG.md docs: generate docs/ from the schema OpenTofu reports 2026-11-16 20:32:59 -05:00
GNUmakefile test: live tests against a OneSignal app 2026-11-16 21:14:33 -05:00
go.mod feat: provider for OneSignal apps, API keys, segments and templates 2026-11-16 20:32:58 -05:00
go.sum feat: provider for OneSignal apps, API keys, segments and templates 2026-11-16 20:32:58 -05:00
LICENSE Initial commit 2026-11-16 20:10:42 -05:00
main.go feat: provider for OneSignal apps, API keys, segments and templates 2026-11-16 20:32:58 -05:00
README.md test: live tests against a OneSignal app 2026-11-16 21:14:33 -05:00
terraform-registry-manifest.json Initial commit 2026-11-16 20:10:42 -05:00

OpenTofu provider for OneSignal

Manages the configuration of OneSignal apps through OneSignal's REST API:

Resource What it manages
onesignal_app An app's settings and its push credentials, which are write-only
onesignal_app_api_key An app's API keys, with their IP allowlists and in-place rotation
onesignal_segment Filter-based segments
onesignal_template Push, email and SMS templates

The data sources onesignal_app and onesignal_apps read one app or list them all.

Not covered: Journeys, whose API is in beta, and everything that is not configuration, such as users, subscriptions, messages and analytics. OneSignal has no API for deleting an app, so destroying an onesignal_app fails; delete the app in the dashboard, then remove it from state.

The documentation for each resource is in docs/.

Requirements

  • OpenTofu 1.11 or later, the first release with write-only attributes. Tested with 1.13.
  • A OneSignal Organization API key.

Installation

The provider is not on a public registry. Builds are served from the mirror at https://opentofu.regulad.xyz/, under the address registry.opentofu.org/regulad/onesignal; see docs/index.md for the CLI configuration that reaches it.

Development

Requires Go (the version in go.mod), OpenTofu, jq, and golangci-lint for make lint.

Command What it does
make build Builds the provider
make test Runs the client's unit tests
make testacc Also runs the resource tests, which drive OpenTofu against an in-memory fake of OneSignal's API
make testlive Runs the live tests against OneSignal
make generate Formats the examples and regenerates docs/ from them, templates/ and the schema
make docs-validate Checks docs/ with tfplugindocs

Nothing in make test or make testacc reaches OneSignal. The fake, in internal/onesignal/fake, follows what the live API was seen to do, quirks included, and its reference where nothing was seen.

make testlive runs the live tests against OneSignal itself, in an app named homelab-provider-test, which must exist, with an Organization API key in ONESIGNAL_ORGANIZATION_API_KEY. They cover app import, API keys and templates.

Not tested against OneSignal:

  • Segment writes, which OneSignal refuses on the Free plan.
  • The app's push credentials and APNs settings, which need real Apple, Firebase and Safari credentials.
  • email_bcc, which needs OneSignal's own email platform.

The docs are generated from the schema as OpenTofu reports it (tools/docs.sh), so no Terraform binary is needed.

Licence

MPL-2.0.