|
|
@ -44,6 +44,7 @@ import (
|
|
|
|
"tailscale.com/types/logger"
|
|
|
|
"tailscale.com/types/logger"
|
|
|
|
"tailscale.com/types/logid"
|
|
|
|
"tailscale.com/types/logid"
|
|
|
|
"tailscale.com/types/netmap"
|
|
|
|
"tailscale.com/types/netmap"
|
|
|
|
|
|
|
|
"tailscale.com/types/ptr"
|
|
|
|
"tailscale.com/util/cibuild"
|
|
|
|
"tailscale.com/util/cibuild"
|
|
|
|
"tailscale.com/util/lineread"
|
|
|
|
"tailscale.com/util/lineread"
|
|
|
|
"tailscale.com/util/must"
|
|
|
|
"tailscale.com/util/must"
|
|
|
@ -87,7 +88,7 @@ func TestMatchRule(t *testing.T) {
|
|
|
|
name: "expired",
|
|
|
|
name: "expired",
|
|
|
|
rule: &tailcfg.SSHRule{
|
|
|
|
rule: &tailcfg.SSHRule{
|
|
|
|
Action: someAction,
|
|
|
|
Action: someAction,
|
|
|
|
RuleExpires: timePtr(time.Unix(100, 0)),
|
|
|
|
RuleExpires: ptr.To(time.Unix(100, 0)),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
ci: &sshConnInfo{},
|
|
|
|
ci: &sshConnInfo{},
|
|
|
|
wantErr: errRuleExpired,
|
|
|
|
wantErr: errRuleExpired,
|
|
|
@ -222,8 +223,6 @@ func TestMatchRule(t *testing.T) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func timePtr(t time.Time) *time.Time { return &t }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// localState implements ipnLocalBackend for testing.
|
|
|
|
// localState implements ipnLocalBackend for testing.
|
|
|
|
type localState struct {
|
|
|
|
type localState struct {
|
|
|
|
sshEnabled bool
|
|
|
|
sshEnabled bool
|
|
|
|