go-sdk

module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: MIT

README

go-sdk

Go SDK for building ILM / OmniTrust connectors.

It provides the two things a connector author would otherwise hand-roll:

  • Contract types — Go DTOs for every connector interface, generated from the platform's OpenAPI specs (connector/model/<interface>/<version>) and patched for correct polymorphic (oneOf) JSON round-tripping.
  • Server scaffoldingconnector/shared gives you the HTTP server, /v2/info + /v2/health, RFC 9457 problem responses, structured connector.log logging with W3C trace/correlation context, a small router, and an optional Prometheus /v1/metrics endpoint (enabled with WithMetrics). connector/provider/<interface>/<version> turns your business logic (a Provider interface you implement) into the interface's routes.

Supported provider interfaces: authority, compliance, credential, cryptography, discovery, entity, notification, secret, plus the connector-global Attributes v2 surface (attributes). One connector process can register several.

Requires Go 1.26+.

Install

go get github.com/OmniTrustILM/go-sdk@vX.Y.Z

Replace vX.Y.Z with a published release tag (see Versioning & releases) — always pin an explicit version rather than @latest or a branch. This records a require github.com/OmniTrustILM/go-sdk vX.Y.Z line in your go.mod.

Quickstart

A minimal Secret Provider connector. Implement the interface's Provider, wrap it in the interface handler, register it on a shared.Connector, and run:

package main

import (
	"context"
	"os/signal"
	"syscall"

	secret "github.com/OmniTrustILM/go-sdk/connector/provider/secret/v1"
	"github.com/OmniTrustILM/go-sdk/connector/shared"
)

// store is your connector's backend. It must implement secret.Provider
// (CreateSecret, GetSecretContent, …); those methods are elided here.
type store struct{ /* ... */ }

func main() {
	handler, err := secret.NewHandler(&store{})
	if err != nil {
		panic(err)
	}

	c, err := shared.New(
		shared.WithAddr(":8080"),
		shared.WithInfo(shared.Info{ID: "my-secret-connector", Name: "My Secret Connector", Version: "1.0.0"}),
		shared.Register(handler),
	)
	if err != nil {
		panic(err)
	}

	ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
	defer stop()
	if err := c.Run(ctx); err != nil {
		panic(err)
	}
}

This is a skeleton, not a copy-paste-runnable program: it compiles once store implements the secret.Provider methods — see the runnable secret-v1 example for a complete version. Once it does, the connector serves /v2/info, /v2/health, and the secret-provider routes under /v1/secretProvider.

Examples

Runnable reference connectors live under connector/examples/ — one per interface, plus multi-v1 (several interfaces in one process). Each is a real, self-contained connector (in-memory backends; reference-only, not for production):

go run ./connector/examples/secret-v1

authority-v3, legacy-auth-v1 (legacy v1 authority interface), compliance-v1/v2, credential-v1, cryptography-v1, disco-v1, entity-v1, notification-v1, secret-v1, multi-v1. They double as the SDK's integration-test suite (see connector/examples/internal/itest).

Versioning & releases

This is a Go library, released the standard Go way — semantic-version git tags. There is no Docker image (a library is consumed as source by the Go toolchain, not run as a container).

The module follows semantic versioning: vMAJOR.MINOR.PATCH (breaking / feature / fix).

Cutting a release (maintainers): tag the chosen commit on main and push the tag —

git tag v1.2.0
git push origin v1.2.0

That is the entire release: the Go module proxy and go get resolve the module at that tag. Publish release notes from the tag on GitHub as desired. (Pre-1.0 the API may change between minor versions per semver's 0.y.z rule.)

Consuming a released version

Dependent connectors pin an explicit release in their own go.mod:

require github.com/OmniTrustILM/go-sdk v1.2.0

Add or move to a release with:

go get github.com/OmniTrustILM/go-sdk@v1.2.0   # pins that exact tag
go mod tidy

To upgrade, re-run go get …@vX.Y.Z against the newer tag and commit the updated go.mod/go.sum. Because the pin is an exact tag, builds are reproducible until you deliberately bump it — always pin a released tag rather than tracking a branch or @latest.

License

MIT — © Identity Lifecycle Management (ILM).

Directories

Path Synopsis
connector
examples/authority-v3 command
Reference Authority Provider v3 connector.
Reference Authority Provider v3 connector.
examples/compliance-v1 command
Reference Compliance Provider v1 connector.
Reference Compliance Provider v1 connector.
examples/compliance-v2 command
Reference Compliance Provider v2 connector.
Reference Compliance Provider v2 connector.
examples/credential-v1 command
Reference Credential Provider connector.
Reference Credential Provider connector.
examples/cryptography-v1 command
Reference Cryptography Provider connector.
Reference Cryptography Provider connector.
examples/disco-v1 command
Reference Discovery Provider connector.
Reference Discovery Provider connector.
examples/entity-v1 command
Reference Entity Provider connector.
Reference Entity Provider connector.
examples/internal/itest
Package itest is the shared integration-test harness for the connector example services under connector/examples/.
Package itest is the shared integration-test harness for the connector example services under connector/examples/.
examples/legacy-auth-v1 command
Reference Legacy Authority Provider connector.
Reference Legacy Authority Provider connector.
examples/multi-v1 command
Combined Discovery + Authority v2 connector.
Combined Discovery + Authority v2 connector.
examples/notification-v1 command
Reference Notification Provider connector.
Reference Notification Provider connector.
examples/secret-v1 command
Reference Secret Provider connector.
Reference Secret Provider connector.
provider/attributes/v2
Package attributes provides connector-agnostic scaffolding for the Attributes v2 API — the connector-global attribute-definition registry plus the dynamic-attribute callback surface that NG (next-generation) connectors serve at GET/POST /v2/attributes*.
Package attributes provides connector-agnostic scaffolding for the Attributes v2 API — the connector-global attribute-definition registry plus the dynamic-attribute callback surface that NG (next-generation) connectors serve at GET/POST /v2/attributes*.
provider/authority/v1
Package authority provides the HTTP server adapter for the Authority Provider Legacy (v1) API.
Package authority provides the HTTP server adapter for the Authority Provider Legacy (v1) API.
provider/authority/v2
Package authority provides the HTTP server adapter for the Authority Provider v2 API.
Package authority provides the HTTP server adapter for the Authority Provider v2 API.
provider/authority/v3
Package authority provides the HTTP server adapter for the Authority Provider v3 API.
Package authority provides the HTTP server adapter for the Authority Provider v3 API.
provider/compliance/v1
Package compliance provides the HTTP server adapter for the Compliance Provider v1 API.
Package compliance provides the HTTP server adapter for the Compliance Provider v1 API.
provider/compliance/v2
Package compliance provides the HTTP server adapter for the Compliance Provider v2 API.
Package compliance provides the HTTP server adapter for the Compliance Provider v2 API.
provider/credential/v1
Package credential provides the HTTP server adapter for the Credential Provider API.
Package credential provides the HTTP server adapter for the Credential Provider API.
provider/cryptography/v1
Package cryptography provides the HTTP server adapter for the Cryptography Provider API.
Package cryptography provides the HTTP server adapter for the Cryptography Provider API.
provider/discovery/v1
Package discovery provides the HTTP server adapter for the Discovery Provider v1 API.
Package discovery provides the HTTP server adapter for the Discovery Provider v1 API.
provider/entity/v1
Package entity provides the HTTP server adapter for the Entity Provider API.
Package entity provides the HTTP server adapter for the Entity Provider API.
provider/notification/v1
Package notification provides the HTTP server adapter for the Notification Provider API.
Package notification provides the HTTP server adapter for the Notification Provider API.
provider/secret/v1
Package secret provides the HTTP server adapter for the Secret Provider v1 API.
Package secret provides the HTTP server adapter for the Secret Provider v1 API.
shared
Package shared provides the HTTP server, request lifecycle, and cross-cutting concerns (logging, tracing, correlation, error handling, health) used by every ILM connector spec.
Package shared provides the HTTP server, request lifecycle, and cross-cutting concerns (logging, tracing, correlation, error handling, health) used by every ILM connector spec.
shared/handlerbase
Package handlerbase provides the shared configuration and option helpers every provider Handler embeds.
Package handlerbase provides the shared configuration and option helpers every provider Handler embeds.
tools
fixoneof command
Post-processes openapi-generator's Go output to replace ambiguous oneOf UnmarshalJSON methods with discriminator-aware versions.
Post-processes openapi-generator's Go output to replace ambiguous oneOf UnmarshalJSON methods with discriminator-aware versions.

Jump to

Keyboard shortcuts

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