2025-09-01 17:10:13 +05:30
|
|
|
package authz
|
|
|
|
|
|
2025-09-04 14:07:11 +05:30
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
|
|
|
|
|
"github.com/SigNoz/signoz/pkg/factory"
|
2025-09-17 21:35:11 +05:30
|
|
|
"github.com/SigNoz/signoz/pkg/types/authtypes"
|
2025-09-04 14:07:11 +05:30
|
|
|
openfgav1 "github.com/openfga/api/proto/openfga/v1"
|
|
|
|
|
)
|
2025-09-01 17:10:13 +05:30
|
|
|
|
|
|
|
|
type AuthZ interface {
|
|
|
|
|
factory.Service
|
2025-09-04 14:07:11 +05:30
|
|
|
|
|
|
|
|
// Check returns error when the upstream authorization server is unavailable or the subject (s) doesn't have relation (r) on object (o).
|
2025-09-29 17:45:52 +05:30
|
|
|
Check(context.Context, *openfgav1.TupleKey) error
|
2025-09-17 21:35:11 +05:30
|
|
|
|
|
|
|
|
// CheckWithTupleCreation takes upon the responsibility for generating the tuples alongside everything Check does.
|
2025-09-29 17:45:52 +05:30
|
|
|
CheckWithTupleCreation(context.Context, authtypes.Claims, authtypes.Relation, authtypes.Typeable, []authtypes.Selector) error
|
|
|
|
|
|
|
|
|
|
// writes the tuples to upstream server
|
|
|
|
|
Write(context.Context, *openfgav1.WriteRequest) error
|
|
|
|
|
|
|
|
|
|
// lists the selectors for objects assigned to subject (s) with relation (r) on resource (s)
|
|
|
|
|
ListObjects(context.Context, string, authtypes.Relation, authtypes.Typeable) ([]*authtypes.Object, error)
|
2025-09-01 17:10:13 +05:30
|
|
|
}
|