Add read/list/cancel:self actions and support for ACL subactions. (#882)
Update perms table in anticipation of session support for these.
This commit is contained in:
1 parent
558f9220a5
commit
0629526319
7 files changed
+125
-6
No files matched your search
@@ -37,6 +37,9 @@ const (
|
||||
AddAccounts Type = 28
|
||||
SetAccounts Type = 29
|
||||
RemoveAccounts Type = 30
|
||||
ReadSelf Type = 31
|
||||
ListSelf Type = 32
|
||||
CancelSelf Type = 33
|
||||
)
|
||||
|
||||
var Map = map[string]Type{
|
||||
@@ -70,6 +73,9 @@ var Map = map[string]Type{
|
||||
AddAccounts.String(): AddAccounts,
|
||||
SetAccounts.String(): SetAccounts,
|
||||
RemoveAccounts.String(): RemoveAccounts,
|
||||
ReadSelf.String(): ReadSelf,
|
||||
ListSelf.String(): ListSelf,
|
||||
CancelSelf.String(): CancelSelf,
|
||||
}
|
||||
|
||||
func (a Type) String() string {
|
||||
@@ -105,6 +111,9 @@ func (a Type) String() string {
|
||||
"add-accounts",
|
||||
"set-accounts",
|
||||
"remove-accounts",
|
||||
"read:self",
|
||||
"list:self",
|
||||
"cancel:self",
|
||||
}[a]
|
||||
}
|
||||
|
||||
|
||||
@@ -75,6 +75,18 @@ func TestAction(t *testing.T) {
|
||||
action: Deauthenticate,
|
||||
want: "deauthenticate",
|
||||
},
|
||||
{
|
||||
action: ReadSelf,
|
||||
want: "read:self",
|
||||
},
|
||||
{
|
||||
action: CancelSelf,
|
||||
want: "cancel:self",
|
||||
},
|
||||
{
|
||||
action: ListSelf,
|
||||
want: "list:self",
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.want, func(t *testing.T) {
|
||||
|
||||
Reference in new issue
Block a user