Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

1.5 KB
Raw Blame
package authdomain

import (
	"context"
	"net/http"

	"github.com/SigNoz/signoz/pkg/statsreporter"
	"github.com/SigNoz/signoz/pkg/types/authtypes"
	"github.com/SigNoz/signoz/pkg/valuer"
)

type Module interface {
	// List all auth domains for an organization.
	ListByOrgID(context.Context, valuer.UUID) ([]*authtypes.AuthDomain, error)

	// Get an auth domain by id.
	Get(context.Context, valuer.UUID) (*authtypes.AuthDomain, error)

	// Get an auth domain by orgID and id.
	GetByOrgIDAndID(context.Context, valuer.UUID, valuer.UUID) (*authtypes.AuthDomain, error)

	// Get an auth domain by name and orgID.
	GetByNameAndOrgID(context.Context, string, valuer.UUID) (*authtypes.AuthDomain, error)

	// Create a new auth domain for an organization.
	Create(context.Context, *authtypes.AuthDomain) error

	// Update an existing auth domain.
	Update(context.Context, *authtypes.AuthDomain) error

	// Delete an existing auth domain by id.
	Delete(context.Context, valuer.UUID, valuer.UUID) error

	// Get the IDP info of the domain provided.
	GetAuthNProviderInfo(context.Context, *authtypes.AuthDomain) *authtypes.AuthNProviderInfo

	statsreporter.StatsCollector
}

type Handler interface {
	List(http.ResponseWriter, *http.Request)
	Get(http.ResponseWriter, *http.Request)
	Create(http.ResponseWriter, *http.Request)
	Update(http.ResponseWriter, *http.Request)
	Delete(http.ResponseWriter, *http.Request)
}

type Getter interface {
	OnBeforeRoleDelete(ctx context.Context, orgID valuer.UUID, roleID valuer.UUID, roleName string) error
}