mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-17 23:47:12 +00:00
* feat(authz): implement the current usecases in openfga * feat(authz): implement the current usecases in openfga * feat(authz): extract out the schema and DI the same * feat(authz): extract out the schema and DI the same
30 lines
478 B
Go
30 lines
478 B
Go
package openfgaschema
|
|
|
|
import (
|
|
"context"
|
|
_ "embed"
|
|
|
|
"github.com/SigNoz/signoz/pkg/authz"
|
|
openfgapkgtransformer "github.com/openfga/language/pkg/go/transformer"
|
|
)
|
|
|
|
var (
|
|
//go:embed base.fga
|
|
baseDSL string
|
|
)
|
|
|
|
type schema struct{}
|
|
|
|
func NewSchema() authz.Schema {
|
|
return &schema{}
|
|
}
|
|
|
|
func (schema *schema) Get(ctx context.Context) []openfgapkgtransformer.ModuleFile {
|
|
return []openfgapkgtransformer.ModuleFile{
|
|
{
|
|
Name: "base.fga",
|
|
Contents: baseDSL,
|
|
},
|
|
}
|
|
}
|