add acl interface
This commit is contained in:
2
go.mod
2
go.mod
@@ -10,7 +10,6 @@ require (
|
||||
github.com/pkg/profile v1.7.0
|
||||
go-simpler.org/env v0.12.0
|
||||
lol.mleku.dev v1.0.2
|
||||
lukechampine.com/frand v1.5.1
|
||||
protocol.orly v0.0.0-00010101000000-000000000000
|
||||
utils.orly v0.0.0-00010101000000-000000000000
|
||||
)
|
||||
@@ -48,6 +47,7 @@ require (
|
||||
)
|
||||
|
||||
replace (
|
||||
acl.orly => ./pkg/acl
|
||||
crypto.orly => ./pkg/crypto
|
||||
database.orly => ./pkg/database
|
||||
encoders.orly => ./pkg/encoders
|
||||
|
||||
13
pkg/acl/go.mod
Normal file
13
pkg/acl/go.mod
Normal file
@@ -0,0 +1,13 @@
|
||||
module acl.orly
|
||||
|
||||
go 1.25.0
|
||||
|
||||
replace (
|
||||
crypto.orly => ../crypto
|
||||
encoders.orly => ../encoders
|
||||
interfaces.orly => ../interfaces
|
||||
next.orly.dev => ../../
|
||||
protocol.orly => ../protocol
|
||||
utils.orly => ../utils
|
||||
acl.orly => ../acl
|
||||
)
|
||||
0
pkg/acl/go.sum
Normal file
0
pkg/acl/go.sum
Normal file
@@ -30,4 +30,5 @@ replace (
|
||||
next.orly.dev => ../../
|
||||
protocol.orly => ../protocol
|
||||
utils.orly => ../utils
|
||||
acl.orly => ../acl
|
||||
)
|
||||
|
||||
@@ -3,6 +3,7 @@ module database.orly
|
||||
go 1.25.0
|
||||
|
||||
replace (
|
||||
acl.orly => ../acl
|
||||
crypto.orly => ../crypto
|
||||
encoders.orly => ../encoders
|
||||
interfaces.orly => ../interfaces
|
||||
|
||||
@@ -24,6 +24,7 @@ require (
|
||||
)
|
||||
|
||||
replace (
|
||||
acl.orly => ../acl
|
||||
crypto.orly => ../crypto
|
||||
encoders.orly => ../encoders
|
||||
interfaces.orly => ../interfaces
|
||||
|
||||
25
pkg/interfaces/acl/acl.go
Normal file
25
pkg/interfaces/acl/acl.go
Normal file
@@ -0,0 +1,25 @@
|
||||
// Package acl is an interface for implementing arbitrary access control lists.
|
||||
package acl
|
||||
|
||||
const (
|
||||
// Read means read only
|
||||
Read = "read"
|
||||
// Write means read and write
|
||||
Write = "write"
|
||||
// Admin means read, write, import/export and arbitrary delete
|
||||
Admin = "admin"
|
||||
// Owner means read, write, import/export, arbitrary delete and wipe
|
||||
Owner = "owner"
|
||||
// Group applies to communities and other groups; the content afterwards a
|
||||
// set of comma separated <permission>:<pubkey> pairs designating permissions to groups.
|
||||
Group = "group:"
|
||||
)
|
||||
|
||||
type I interface {
|
||||
// GetAccessLevel returns the access level string for a given pubkey.
|
||||
GetAccessLevel(pub []byte) (level string)
|
||||
// GetACLInfo returns the name and a description of the ACL, which should
|
||||
// explain briefly how it works, and then a long text of documentation of
|
||||
// the ACL's rules and configuration (in asciidoc or markdown).
|
||||
GetACLInfo() (name, description, documentation string)
|
||||
}
|
||||
@@ -3,6 +3,7 @@ module interfaces.orly
|
||||
go 1.25.0
|
||||
|
||||
replace (
|
||||
acl.orly => ../acl
|
||||
crypto.orly => ../crypto
|
||||
database.orly => ../database
|
||||
encoders.orly => ../encoders
|
||||
|
||||
@@ -23,6 +23,7 @@ require (
|
||||
)
|
||||
|
||||
replace (
|
||||
acl.orly => ../acl
|
||||
crypto.orly => ../crypto
|
||||
encoders.orly => ../encoders
|
||||
interfaces.orly => ../interfaces
|
||||
|
||||
@@ -29,6 +29,7 @@ require (
|
||||
)
|
||||
|
||||
replace (
|
||||
acl.orly => ../acl
|
||||
crypto.orly => ../crypto
|
||||
encoders.orly => ../encoders
|
||||
interfaces.orly => ../interfaces
|
||||
|
||||
Reference in New Issue
Block a user