File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import (
1010 "net/http"
1111 "os"
1212 "strings"
13+ "time"
1314)
1415
1516const BEARER_SCHEMA = "Bearer "
@@ -44,7 +45,7 @@ func start() error {
4445 return err
4546 }
4647
47- expirySeconds := uint64 ( 300 )
48+ expiry := 5 * time . Minute
4849 capabilities := tailscale.KeyCapabilities {}
4950 capabilities .Devices .Create .Reusable = false
5051 capabilities .Devices .Create .Ephemeral = true
@@ -74,7 +75,7 @@ func start() error {
7475 }
7576
7677 if ok , _ := evaluator .Evaluate (claims ); ok {
77- key , err := client .CreateKey (ctx , capabilities , tailscale .WithKeyExpirySeconds ( expirySeconds ))
78+ key , err := client .CreateKey (ctx , capabilities , tailscale .WithKeyExpiry ( expiry ))
7879 if err != nil {
7980 return echo .ErrInternalServerError
8081 }
Original file line number Diff line number Diff line change @@ -2,13 +2,11 @@ module github.com/jsiebens/tskeyservice
22
33go 1.19
44
5- replace github.com/tailscale/tailscale-client-go v1.7.0 => github.com/jsiebens/tailscale-client-go v0.0.0-20221108073316-a64d102ba541
6-
75require (
86 github.com/coreos/go-oidc/v3 v3.4.0
97 github.com/hashicorp/go-bexpr v0.1.11
108 github.com/labstack/echo/v4 v4.9.1
11- github.com/tailscale/tailscale-client-go v1.7.0
9+ github.com/tailscale/tailscale-client-go v1.6.1-0.20221130102115-2b0c25ac47da
1210)
1311
1412require (
Original file line number Diff line number Diff line change @@ -212,6 +212,8 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
212212github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk =
213213github.com/tailscale/hujson v0.0.0-20220506213045-af5ed07155e5 h1:erxeiTyq+nw4Cz5+hLDkOwNF5/9IQWCQPv0gpb3+QHU =
214214github.com/tailscale/hujson v0.0.0-20220506213045-af5ed07155e5 /go.mod h1:DFSS3NAGHthKo1gTlmEcSBiZrRJXi28rLNd/1udP1c8 =
215+ github.com/tailscale/tailscale-client-go v1.6.1-0.20221130102115-2b0c25ac47da h1:NVD8zi1H7x0RcXUCgTGVffwHVw34CC31/O/nMxKXOk8 =
216+ github.com/tailscale/tailscale-client-go v1.6.1-0.20221130102115-2b0c25ac47da /go.mod h1:vHy4QKSL+16KKl12Gfa3kf13lu/4lJjFINDsnzOCi/M =
215217github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw =
216218github.com/valyala/bytebufferpool v1.0.0 /go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc =
217219github.com/valyala/fasttemplate v1.2.1 h1:TVEnxayobAdVkhQfrfes2IzOB6o+z4roRkPF52WA1u4 =
You can’t perform that action at this time.
0 commit comments