-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
authorizer,server: update PeerCaps to ACL grants
Now that ACL grants have been launched publicly, update the names of these functions to match the preferred terminology. Leave authorizer.PeerCaps as a temporary migration shim for now. Signed-off-by: M. J. Fromberger <[email protected]>
- Loading branch information
1 parent
75c9717
commit 51483e0
Showing
5 changed files
with
21 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,14 +11,16 @@ import ( | |
"tailscale.com/tailcfg" | ||
) | ||
|
||
const tailsqlCap = "tailscale.com/cap/tailsql" | ||
|
||
var ( | ||
taggedNode = &apitype.WhoIsResponse{ | ||
Node: &tailcfg.Node{Name: "fake.ts.net", Tags: []string{"tag:special"}}, | ||
UserProfile: &tailcfg.UserProfile{ | ||
ID: 1, LoginName: "[email protected]", DisplayName: "Some P. User", | ||
}, | ||
CapMap: tailcfg.PeerCapMap{ | ||
"https://tailscale.com/cap/tailsql": []tailcfg.RawMessage{ | ||
tailsqlCap: []tailcfg.RawMessage{ | ||
`{"src":["main","alt"]}`, | ||
}, | ||
}, | ||
|
@@ -29,15 +31,15 @@ var ( | |
ID: 1, LoginName: "[email protected]", DisplayName: "Some P. User", | ||
}, | ||
CapMap: tailcfg.PeerCapMap{ | ||
"https://tailscale.com/cap/tailsql": []tailcfg.RawMessage{ | ||
tailsqlCap: []tailcfg.RawMessage{ | ||
`{"src":["main"]}`, | ||
}, | ||
}, | ||
} | ||
) | ||
|
||
func TestPeerCaps(t *testing.T) { | ||
auth := authorizer.PeerCaps(t.Logf) | ||
func TestACLGrants(t *testing.T) { | ||
auth := authorizer.ACLGrants(t.Logf) | ||
tests := []struct { | ||
src string | ||
rsp *apitype.WhoIsResponse | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters