MCPcopy
hub / github.com/gliderlabs/ssh / TestSetPermissions

Function TestSetPermissions

context_test.go:8–27  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

6)
7
8func TestSetPermissions(t *testing.T) {
9 t.Parallel()
10 permsExt := map[string]string{
11 "foo": "bar",
12 }
13 session, _, cleanup := newTestSessionWithOptions(t, &Server{
14 Handler: func(s Session) {
15 if _, ok := s.Permissions().Extensions["foo"]; !ok {
16 t.Fatalf("got %#v; want %#v", s.Permissions().Extensions, permsExt)
17 }
18 },
19 }, nil, PasswordAuth(func(ctx Context, password string) bool {
20 ctx.Permissions().Extensions = permsExt
21 return true
22 }))
23 defer cleanup()
24 if err := session.Run(""); err != nil {
25 t.Fatal(err)
26 }
27}
28
29func TestSetValue(t *testing.T) {
30 t.Parallel()

Callers

nothing calls this directly

Calls 3

PasswordAuthFunction · 0.85
PermissionsMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…