mirror of
https://github.com/hanzoai/o11y.git
synced 2026-10-15 12:58:33 +00:00
Re-apply the Hanzo-original packages that the wholesale SigNoz re-sync reverted,
reconciled against the new latest-SigNoz APIs. Build stays green (go build ./...
= 0, incl. -mod=readonly).
authz — Hanzo IAM is now the ONE AND ONLY authorization provider. OpenFGA is
ripped out entirely, not merely defaulted-away:
* Deleted pkg/authz/openfgaauthz, openfgaserver, openfgaschema, schema.go.
* Dropped github.com/openfga/* from go.mod/go.sum (go mod tidy).
* Removed the openfgav1 proto TupleKey from the authz.AuthZ interface and
authtypes; introduced a Hanzo-native authtypes.TupleKey / ReadRequestTupleKey
(a plain user/relation/object triple). This is what let openfga leave go.mod.
* New pkg/authz/iamauthz implements authz.AuthZ as the sole provider: the
decision path (Check*, BatchCheck, CheckTransactions) delegates to Hanzo IAM's
Casbin enforce endpoint over plain HTTP+JSON (/v1/iam/batch-enforce); tuple
storage (Write/Grant/Revoke/ReadTuples/ListObjects) maps onto IAM policies
(/v1/iam/{add,remove}-policy, get-policies). Role metadata stays in the local
SQL role store (not an IAM concern). Tuple (User,Relation,Object) → Casbin
(sub,obj,act) = (User,Object,Relation). Secrets (client id/secret) come from
env, never config.
* Wired as the sole factory in cmd/community/server.go; authz.Config default
provider = "iam". No provider-selection indirection remains.
zapreceiver + zapmetricreceiver — restored the luxfi/zap-native span/metric batch
receivers; API matches luxfi/zap v1.2.0 unchanged (promoted to a direct dep).
Tests pass.
billing + billingtypes — restored both standalone packages (types + noop Handler
contract). Their old route wiring lived in pkg/apiserver/o11yapiserver, which the
re-sync replaced with signozapiserver; recreating that provider is out of scope,
so billing is available-but-unwired pending an apiserver seam.
No ee/, no github.com/SigNoz/* imports, mount.go/NOTICE/LICENSE untouched.
34 lines
1.2 KiB
Go
34 lines
1.2 KiB
Go
// Package billing is the o11y billing handler contract.
|
|
//
|
|
// The community build supplies a noop implementation; an enterprise
|
|
// build overrides it. The route layer in pkg/apiserver/o11yapiserver
|
|
// wires whichever handler is registered.
|
|
package billing
|
|
|
|
import "net/http"
|
|
|
|
// Handler is the http handler set for billing routes.
|
|
type Handler interface {
|
|
PutProfile(w http.ResponseWriter, r *http.Request)
|
|
GetHosts(w http.ResponseWriter, r *http.Request)
|
|
PutHost(w http.ResponseWriter, r *http.Request)
|
|
}
|
|
|
|
// NewNoopHandler returns a Handler that responds 501 Not Implemented on
|
|
// every route. Community builds use this; enterprise builds replace it.
|
|
func NewNoopHandler() Handler { return noop{} }
|
|
|
|
type noop struct{}
|
|
|
|
func (noop) PutProfile(w http.ResponseWriter, _ *http.Request) {
|
|
http.Error(w, "billing routes require enterprise build", http.StatusNotImplemented)
|
|
}
|
|
|
|
func (noop) GetHosts(w http.ResponseWriter, _ *http.Request) {
|
|
http.Error(w, "billing routes require enterprise build", http.StatusNotImplemented)
|
|
}
|
|
|
|
func (noop) PutHost(w http.ResponseWriter, _ *http.Request) {
|
|
http.Error(w, "billing routes require enterprise build", http.StatusNotImplemented)
|
|
}
|