-
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.
go.mod: update tailscale.com to commit 794af40f68e0
The tailcfg.UserProfile no longer has a Groups field, so also remove the code that was testing for the ability to use it. Now that ACL grants are available, this is no longer needed.
- Loading branch information
1 parent
b0a4155
commit e31fa22
Showing
3 changed files
with
20 additions
and
36 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,6 @@ import ( | |
"github.com/tailscale/tailsql/authorizer" | ||
"github.com/tailscale/tailsql/server/tailsql" | ||
"github.com/tailscale/tailsql/uirules" | ||
"golang.org/x/exp/slices" | ||
"modernc.org/sqlite" | ||
sqlitelib "modernc.org/sqlite/lib" | ||
"tailscale.com/client/tailscale/apitype" | ||
|
@@ -366,12 +365,6 @@ func TestAuth(t *testing.T) { | |
LoginName: "[email protected]", | ||
DisplayName: "Hermanita Q. Testwaller", | ||
} | ||
userProfile2 = &tailcfg.UserProfile{ | ||
ID: 404, // i.e., not testUser | ||
LoginName: "[email protected]", | ||
DisplayName: "Aloysius P. von Testenschön", | ||
Groups: []string{"group:special"}, | ||
} | ||
) | ||
|
||
_, db := mustInitSQLite(t) | ||
|
@@ -389,8 +382,6 @@ func TestAuth(t *testing.T) { | |
return nil // no authorization required for "main" | ||
} else if wr.UserProfile.ID == testUser { | ||
return nil // this user is explicitly allowed | ||
} else if src == "special" && slices.Contains(wr.UserProfile.Groups, "group:special") { | ||
return nil // this group is explicitly allowed for "special" | ||
} else { | ||
return errors.New("authorization denied") // fail closed | ||
} | ||
|
@@ -449,18 +440,6 @@ func TestAuth(t *testing.T) { | |
t.Run("ValidUnauth", func(t *testing.T) { | ||
mustCall(t, htest.URL+"?src=other", http.StatusForbidden) | ||
}) | ||
|
||
// Authorization by group fails for a user not in the group. | ||
t.Run("NonGroupMember", func(t *testing.T) { | ||
mustCall(t, htest.URL+"?src=special", http.StatusForbidden) | ||
}) | ||
|
||
fc.result.UserProfile = userProfile2 | ||
|
||
// Authorization succeeds for a user in the group. | ||
t.Run("GroupMember", func(t *testing.T) { | ||
mustCall(t, htest.URL+"?src=special", http.StatusOK) | ||
}) | ||
} | ||
|
||
// Verify that context cancellation is correctly propagated. | ||
|