mirror of
https://github.com/gravitational/teleport
synced 2024-10-19 00:33:50 +00:00
use google/uuid instead of pborman/uuid (#9793)
* replace imports * use google/uuid * fix test * reverse changelog changes * update gomod * zac steps * tidy Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
This commit is contained in:
parent
8932ed4e03
commit
62173e096b
|
@ -3,6 +3,6 @@ module go-client
|
|||
go 1.15
|
||||
|
||||
require (
|
||||
github.com/google/uuid v1.0.0
|
||||
github.com/gravitational/teleport/api v0.0.0-20210824015240-4aa94989f6d6
|
||||
github.com/pborman/uuid v1.2.1
|
||||
)
|
||||
|
|
|
@ -43,8 +43,6 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
|||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
|
||||
github.com/pborman/uuid v1.2.1 h1:+ZZIw58t/ozdjRaXh/3awHfmWRbzYxJoAdNJxe/3pvw=
|
||||
github.com/pborman/uuid v1.2.1/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
|
|
|
@ -24,7 +24,7 @@ import (
|
|||
"github.com/gravitational/teleport/api/client"
|
||||
"github.com/gravitational/teleport/api/types"
|
||||
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -50,7 +50,7 @@ func main() {
|
|||
|
||||
func demoClient(ctx context.Context, clt *client.Client) (err error) {
|
||||
// Create a new access request for the `access-admin` user to use the `admin` role.
|
||||
accessReq, err := types.NewAccessRequest(uuid.New(), "access-admin", "admin")
|
||||
accessReq, err := types.NewAccessRequest(uuid.New().String(), "access-admin", "admin")
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to make new access request: %w", err)
|
||||
}
|
||||
|
|
13
go.mod
13
go.mod
|
@ -46,7 +46,7 @@ require (
|
|||
github.com/gravitational/kingpin v2.1.11-0.20190130013101-742f2714c145+incompatible
|
||||
github.com/gravitational/license v0.0.0-20210218173955-6d8fb49b117a
|
||||
github.com/gravitational/oxy v0.0.0-20211213172937-a1ba0900a4c9
|
||||
github.com/gravitational/reporting v0.0.0-20180907002058-ac7b85c75c4c
|
||||
github.com/gravitational/reporting v0.0.0-20210923183620-237377721140
|
||||
github.com/gravitational/roundtrip v1.0.1
|
||||
github.com/gravitational/teleport/api v0.0.0
|
||||
github.com/gravitational/trace v1.1.16-0.20211111002323-2897205b8d7f
|
||||
|
@ -67,7 +67,6 @@ require (
|
|||
github.com/mailgun/ttlmap v0.0.0-20170619185759-c1c17f74874f
|
||||
github.com/mattn/go-sqlite3 v1.14.6
|
||||
github.com/moby/term v0.0.0-20201216013528-df9cb8a40635
|
||||
github.com/pborman/uuid v1.2.1
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/pquerna/otp v1.3.0
|
||||
github.com/prometheus/client_golang v1.11.0
|
||||
|
@ -88,16 +87,16 @@ require (
|
|||
go.uber.org/atomic v1.7.0
|
||||
golang.org/x/crypto v0.0.0-20211202192323-5770296d904e
|
||||
golang.org/x/mod v0.4.2
|
||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2
|
||||
golang.org/x/net v0.0.0-20220114011407-0dd24b26b47d
|
||||
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1
|
||||
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9
|
||||
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d
|
||||
golang.org/x/text v0.3.6
|
||||
golang.org/x/text v0.3.7
|
||||
golang.org/x/tools v0.1.5
|
||||
google.golang.org/api v0.29.0
|
||||
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c
|
||||
google.golang.org/genproto v0.0.0-20220118154757-00ab72f36ad5
|
||||
google.golang.org/grpc v1.43.0
|
||||
google.golang.org/protobuf v1.26.0
|
||||
google.golang.org/protobuf v1.27.1
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
|
||||
gopkg.in/ini.v1 v1.62.0
|
||||
gopkg.in/square/go-jose.v2 v2.5.1
|
||||
|
|
29
go.sum
29
go.sum
|
@ -70,6 +70,7 @@ github.com/HdrHistogram/hdrhistogram-go v1.0.1/go.mod h1:BWJ+nMSHY3L41Zj7CA3uXnl
|
|||
github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk=
|
||||
github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0=
|
||||
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
|
||||
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
|
||||
github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
|
||||
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
|
||||
github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
|
||||
|
@ -132,6 +133,8 @@ github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBW
|
|||
github.com/boombuler/barcode v1.0.1 h1:NDBbPmhS+EqABEs5Kg3n/5ZNjy73Pz7SIV+KCeqyXcs=
|
||||
github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
|
||||
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
|
||||
github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY=
|
||||
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
|
||||
|
@ -143,6 +146,7 @@ github.com/cloudflare/cfssl v0.0.0-20190726000631-633726f6bcb7/go.mod h1:yMWuSON
|
|||
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
|
||||
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
|
||||
github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI=
|
||||
github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
||||
github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
||||
github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
||||
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
||||
|
@ -180,6 +184,7 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m
|
|||
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
|
||||
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
|
||||
github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
|
||||
github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
|
||||
github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0=
|
||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||
github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
|
||||
|
@ -326,7 +331,6 @@ github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hf
|
|||
github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/pprof v0.0.0-20200507031123-427632fa3b1c/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs=
|
||||
|
@ -363,8 +367,8 @@ github.com/gravitational/oxy v0.0.0-20211213172937-a1ba0900a4c9 h1:7NyppZS8QFt28
|
|||
github.com/gravitational/oxy v0.0.0-20211213172937-a1ba0900a4c9/go.mod h1:ESOxlf8BB2yG3zJ0SfZe9U6wpYu3YF3znxIICg73FYA=
|
||||
github.com/gravitational/protobuf v1.3.2-0.20201123192827-2b9fcfaffcbf h1:MQ4e8XcxvZTeuOmRl7yE519vcWc2h/lyvYzsvt41cdY=
|
||||
github.com/gravitational/protobuf v1.3.2-0.20201123192827-2b9fcfaffcbf/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
|
||||
github.com/gravitational/reporting v0.0.0-20180907002058-ac7b85c75c4c h1:UwN3jo2EfZSGDchLVqH/EJ2A5GWvKROx3NJNUI6/plg=
|
||||
github.com/gravitational/reporting v0.0.0-20180907002058-ac7b85c75c4c/go.mod h1:rBJeI3JYVzbL7Yw2hYrp4QdKIkncb1pUHo95DyoEGns=
|
||||
github.com/gravitational/reporting v0.0.0-20210923183620-237377721140 h1:UACNXsuOXxe2dpjn3SA2g4YUgOoZTxQ6yf+QYAYcQMc=
|
||||
github.com/gravitational/reporting v0.0.0-20210923183620-237377721140/go.mod h1:rBJeI3JYVzbL7Yw2hYrp4QdKIkncb1pUHo95DyoEGns=
|
||||
github.com/gravitational/roundtrip v1.0.1 h1:eD/y0av12Gu9VIwNgPY/ltmpeVk0Azek/yIJvOPuTuY=
|
||||
github.com/gravitational/roundtrip v1.0.1/go.mod h1:qccpLd30tAJVSpx7aOEEnws4ZT3njPwdbtT8lNQxbAs=
|
||||
github.com/gravitational/trace v1.1.15/go.mod h1:RvdOUHE4SHqR3oXlFFKnGzms8a5dugHygGw1bqDstYI=
|
||||
|
@ -534,8 +538,6 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W
|
|||
github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
|
||||
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
github.com/pborman/uuid v1.2.1 h1:+ZZIw58t/ozdjRaXh/3awHfmWRbzYxJoAdNJxe/3pvw=
|
||||
github.com/pborman/uuid v1.2.1/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
|
||||
github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE=
|
||||
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
|
||||
github.com/pingcap/check v0.0.0-20190102082844-67f458068fc8 h1:USx2/E1bX46VG32FIw034Au6seQ2fY9NEILmNh/UlQg=
|
||||
|
@ -612,6 +614,7 @@ github.com/smartystreets/assertions v1.2.0 h1:42S6lae5dvLc7BrLu/0ugRtcFVjoJNMC/N
|
|||
github.com/smartystreets/assertions v1.2.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo=
|
||||
github.com/smartystreets/goconvey v1.7.2 h1:9RBaZCeXEQ3UselpuwUQHltGVXvdwm6cv1hgR6gDIPg=
|
||||
github.com/smartystreets/goconvey v1.7.2/go.mod h1:Vw0tHAZW6lzCRk3xgdin6fKYcG+G3Pg9vgXWeJpQFMM=
|
||||
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
||||
github.com/spf13/afero v1.2.1/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
|
||||
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
|
||||
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
|
||||
|
@ -769,8 +772,9 @@ golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81R
|
|||
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
||||
golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 h1:CIJ76btIcR3eFI5EgSo6k1qKw9KJexJuRLI9G7Hp5wE=
|
||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20220114011407-0dd24b26b47d h1:1n1fc535VhN8SYtD4cDUyNlfpAF2ROMM9+11equK3hs=
|
||||
golang.org/x/net v0.0.0-20220114011407-0dd24b26b47d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
|
@ -843,8 +847,9 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w
|
|||
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 h1:SrN+KX8Art/Sf4HNj6Zcz06G7VEz+7w9tdXTPOZ7+l4=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 h1:XfKQ4OlFl8okEOr5UvAqFRVj8pY/4yfcXrddB8qAbU0=
|
||||
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d h1:SZxvLBoTP5yHO3Frd4z4vrF+DBX9vMVanchswa69toE=
|
||||
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
|
@ -855,8 +860,9 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
|||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs=
|
||||
|
@ -978,8 +984,9 @@ google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1m
|
|||
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
|
||||
google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
|
||||
google.golang.org/genproto v0.0.0-20200626011028-ee7919e894b5/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c h1:wtujag7C+4D6KMoulW9YauvK2lgdvCMS260jsqqBXr0=
|
||||
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
|
||||
google.golang.org/genproto v0.0.0-20220118154757-00ab72f36ad5 h1:zzNejm+EgrbLfDZ6lu9Uud2IVvHySPl8vQzf04laR5Q=
|
||||
google.golang.org/genproto v0.0.0-20220118154757-00ab72f36ad5/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
||||
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
|
||||
|
@ -993,6 +1000,7 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji
|
|||
google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
|
||||
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
||||
google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
|
||||
google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
|
||||
google.golang.org/grpc v1.43.0 h1:Eeu7bZtDZ2DpRCsLhUlcrLnvYaMK1Gz86a+hMVvELmM=
|
||||
google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
|
@ -1006,8 +1014,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD
|
|||
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
|
||||
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ=
|
||||
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
|
|
|
@ -53,9 +53,9 @@ import (
|
|||
"github.com/gravitational/teleport/lib/web"
|
||||
"github.com/gravitational/teleport/lib/web/app"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/gravitational/oxy/forward"
|
||||
"github.com/gravitational/trace"
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/stretchr/testify/require"
|
||||
"golang.org/x/net/websocket"
|
||||
)
|
||||
|
@ -365,7 +365,7 @@ func TestAppAccessNoHeaderOverrides(t *testing.T) {
|
|||
Value: appCookie,
|
||||
})
|
||||
for _, headerName := range forwardedHeaderNames {
|
||||
req.Header.Set(headerName, uuid.New())
|
||||
req.Header.Set(headerName, uuid.New().String())
|
||||
}
|
||||
|
||||
// Issue the request.
|
||||
|
@ -820,28 +820,28 @@ func setupWithOptions(t *testing.T, opts appTestOptions) *pack {
|
|||
rootAppName: "app-01",
|
||||
rootAppPublicAddr: "app-01.example.com",
|
||||
rootAppClusterName: "example.com",
|
||||
rootMessage: uuid.New(),
|
||||
rootMessage: uuid.New().String(),
|
||||
|
||||
rootWSAppName: "ws-01",
|
||||
rootWSPublicAddr: "ws-01.example.com",
|
||||
rootWSMessage: uuid.New(),
|
||||
rootWSMessage: uuid.New().String(),
|
||||
|
||||
rootWSSAppName: "wss-01",
|
||||
rootWSSPublicAddr: "wss-01.example.com",
|
||||
rootWSSMessage: uuid.New(),
|
||||
rootWSSMessage: uuid.New().String(),
|
||||
|
||||
leafAppName: "app-02",
|
||||
leafAppPublicAddr: "app-02.example.com",
|
||||
leafAppClusterName: "leaf.example.com",
|
||||
leafMessage: uuid.New(),
|
||||
leafMessage: uuid.New().String(),
|
||||
|
||||
leafWSAppName: "ws-02",
|
||||
leafWSPublicAddr: "ws-02.example.com",
|
||||
leafWSMessage: uuid.New(),
|
||||
leafWSMessage: uuid.New().String(),
|
||||
|
||||
leafWSSAppName: "wss-02",
|
||||
leafWSSPublicAddr: "wss-02.example.com",
|
||||
leafWSSMessage: uuid.New(),
|
||||
leafWSSMessage: uuid.New().String(),
|
||||
|
||||
jwtAppName: "app-03",
|
||||
jwtAppPublicAddr: "app-03.example.com",
|
||||
|
@ -935,7 +935,7 @@ func setupWithOptions(t *testing.T, opts appTestOptions) *pack {
|
|||
// Create a new Teleport instance with passed in configuration.
|
||||
p.rootCluster = NewInstance(InstanceConfig{
|
||||
ClusterName: "example.com",
|
||||
HostID: uuid.New(),
|
||||
HostID: uuid.New().String(),
|
||||
NodeName: Host,
|
||||
Priv: privateKey,
|
||||
Pub: publicKey,
|
||||
|
@ -946,7 +946,7 @@ func setupWithOptions(t *testing.T, opts appTestOptions) *pack {
|
|||
// Create a new Teleport instance with passed in configuration.
|
||||
p.leafCluster = NewInstance(InstanceConfig{
|
||||
ClusterName: "leaf.example.com",
|
||||
HostID: uuid.New(),
|
||||
HostID: uuid.New().String(),
|
||||
NodeName: Host,
|
||||
Priv: privateKey,
|
||||
Pub: publicKey,
|
||||
|
@ -1063,8 +1063,8 @@ func setupWithOptions(t *testing.T, opts appTestOptions) *pack {
|
|||
|
||||
// initUser will create a user within the root cluster.
|
||||
func (p *pack) initUser(t *testing.T, opts appTestOptions) {
|
||||
p.username = uuid.New()
|
||||
p.password = uuid.New()
|
||||
p.username = uuid.New().String()
|
||||
p.password = uuid.New().String()
|
||||
|
||||
user, err := types.NewUser(p.username)
|
||||
require.NoError(t, err)
|
||||
|
@ -1292,7 +1292,7 @@ func (p *pack) makeTLSConfigNoSession(t *testing.T, publicAddr, clusterName stri
|
|||
PublicAddr: publicAddr,
|
||||
ClusterName: clusterName,
|
||||
// Use arbitrary session ID
|
||||
SessionID: uuid.New(),
|
||||
SessionID: uuid.New().String(),
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
|
|
|
@ -38,9 +38,9 @@ import (
|
|||
"github.com/gravitational/teleport/lib/tlsca"
|
||||
"github.com/gravitational/teleport/lib/utils"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/jackc/pgconn"
|
||||
"github.com/jonboulle/clockwork"
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/siddontang/go-mysql/client"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
@ -562,7 +562,7 @@ func setupDatabaseTest(t *testing.T, options ...testOptionFunc) *databasePack {
|
|||
// Create root cluster.
|
||||
p.root.cluster = NewInstance(InstanceConfig{
|
||||
ClusterName: "root.example.com",
|
||||
HostID: uuid.New(),
|
||||
HostID: uuid.New().String(),
|
||||
NodeName: opts.nodeName,
|
||||
Priv: privateKey,
|
||||
Pub: publicKey,
|
||||
|
@ -573,7 +573,7 @@ func setupDatabaseTest(t *testing.T, options ...testOptionFunc) *databasePack {
|
|||
// Create leaf cluster.
|
||||
p.leaf.cluster = NewInstance(InstanceConfig{
|
||||
ClusterName: "leaf.example.com",
|
||||
HostID: uuid.New(),
|
||||
HostID: uuid.New().String(),
|
||||
NodeName: opts.nodeName,
|
||||
Ports: opts.instancePortsFunc(),
|
||||
Priv: privateKey,
|
||||
|
|
|
@ -66,8 +66,8 @@ import (
|
|||
"github.com/gravitational/teleport/lib/sshutils"
|
||||
"github.com/gravitational/teleport/lib/utils"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/gravitational/trace"
|
||||
"github.com/pborman/uuid"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
@ -5504,7 +5504,7 @@ func TestWebProxyInsecure(t *testing.T) {
|
|||
|
||||
rc := NewInstance(InstanceConfig{
|
||||
ClusterName: "example.com",
|
||||
HostID: uuid.New(),
|
||||
HostID: uuid.New().String(),
|
||||
NodeName: Host,
|
||||
Priv: privateKey,
|
||||
Pub: publicKey,
|
||||
|
@ -5548,7 +5548,7 @@ func TestTraitsPropagation(t *testing.T) {
|
|||
// Create root cluster.
|
||||
rc := NewInstance(InstanceConfig{
|
||||
ClusterName: "root.example.com",
|
||||
HostID: uuid.New(),
|
||||
HostID: uuid.New().String(),
|
||||
NodeName: Host,
|
||||
Priv: privateKey,
|
||||
Pub: publicKey,
|
||||
|
@ -5558,7 +5558,7 @@ func TestTraitsPropagation(t *testing.T) {
|
|||
// Create leaf cluster.
|
||||
lc := NewInstance(InstanceConfig{
|
||||
ClusterName: "leaf.example.com",
|
||||
HostID: uuid.New(),
|
||||
HostID: uuid.New().String(),
|
||||
NodeName: Host,
|
||||
Priv: privateKey,
|
||||
Pub: publicKey,
|
||||
|
@ -5652,7 +5652,7 @@ func TestTraitsPropagation(t *testing.T) {
|
|||
// testSessionStreaming tests streaming events from session recordings.
|
||||
func testSessionStreaming(t *testing.T, suite *integrationTestSuite) {
|
||||
ctx := context.Background()
|
||||
sessionID := session.ID(uuid.New())
|
||||
sessionID := session.ID(uuid.New().String())
|
||||
teleport := suite.newTeleport(t, nil, true)
|
||||
defer teleport.StopAll()
|
||||
|
||||
|
|
|
@ -47,8 +47,8 @@ import (
|
|||
"github.com/gravitational/teleport/lib/srv/db/postgres"
|
||||
"github.com/gravitational/teleport/lib/utils"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/jackc/pgconn"
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
|
@ -88,7 +88,7 @@ func newProxySuite(t *testing.T, opts ...proxySuiteOptionsFunc) *ProxySuite {
|
|||
|
||||
rc := NewInstance(InstanceConfig{
|
||||
ClusterName: "root.example.com",
|
||||
HostID: uuid.New(),
|
||||
HostID: uuid.New().String(),
|
||||
NodeName: Host,
|
||||
log: utils.NewLoggerForTests(),
|
||||
Ports: options.rootClusterPorts,
|
||||
|
@ -97,7 +97,7 @@ func newProxySuite(t *testing.T, opts ...proxySuiteOptionsFunc) *ProxySuite {
|
|||
// Create leaf cluster.
|
||||
lc := NewInstance(InstanceConfig{
|
||||
ClusterName: "leaf.example.com",
|
||||
HostID: uuid.New(),
|
||||
HostID: uuid.New().String(),
|
||||
NodeName: Host,
|
||||
Priv: rc.Secrets.PrivKey,
|
||||
Pub: rc.Secrets.PubKey,
|
||||
|
|
|
@ -29,7 +29,7 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/google/uuid"
|
||||
"github.com/stretchr/testify/require"
|
||||
"go.mongodb.org/mongo-driver/bson"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
@ -583,7 +583,7 @@ func TestALPNProxyAuthClientConnectWithUserIdentity(t *testing.T) {
|
|||
|
||||
rc := NewInstance(InstanceConfig{
|
||||
ClusterName: "root.example.com",
|
||||
HostID: uuid.New(),
|
||||
HostID: uuid.New().String(),
|
||||
NodeName: Loopback,
|
||||
log: utils.NewLoggerForTests(),
|
||||
Ports: singleProxyPortSetup(),
|
||||
|
@ -636,7 +636,7 @@ func TestALPNProxyDialProxySSHWithoutInsecureMode(t *testing.T) {
|
|||
|
||||
rc := NewInstance(InstanceConfig{
|
||||
ClusterName: "root.example.com",
|
||||
HostID: uuid.New(),
|
||||
HostID: uuid.New().String(),
|
||||
NodeName: Loopback,
|
||||
Priv: privateKey,
|
||||
Pub: publicKey,
|
||||
|
@ -700,7 +700,7 @@ func TestALPNProxyHTTPProxyNoProxyDial(t *testing.T) {
|
|||
|
||||
rc := NewInstance(InstanceConfig{
|
||||
ClusterName: "root.example.com",
|
||||
HostID: uuid.New(),
|
||||
HostID: uuid.New().String(),
|
||||
NodeName: Loopback,
|
||||
log: utils.NewLoggerForTests(),
|
||||
Ports: singleProxyPortSetup(),
|
||||
|
|
|
@ -39,8 +39,8 @@ import (
|
|||
"github.com/gravitational/teleport/lib/utils"
|
||||
"github.com/gravitational/trace"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/jonboulle/clockwork"
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/stretchr/testify/require"
|
||||
"golang.org/x/crypto/ssh"
|
||||
)
|
||||
|
@ -226,7 +226,7 @@ func newSrvCtx(ctx context.Context, t *testing.T) *SrvCtx {
|
|||
s.signer, err = sshutils.NewSigner(priv, certs.SSH)
|
||||
require.NoError(t, err)
|
||||
|
||||
s.nodeID = uuid.New()
|
||||
s.nodeID = uuid.New().String()
|
||||
s.nodeClient, err = s.server.NewClient(auth.TestIdentity{
|
||||
I: auth.BuiltinRole{
|
||||
Role: types.RoleNode,
|
||||
|
|
|
@ -44,9 +44,9 @@ import (
|
|||
|
||||
"github.com/coreos/go-oidc/oauth2"
|
||||
"github.com/coreos/go-oidc/oidc"
|
||||
"github.com/google/uuid"
|
||||
"github.com/gravitational/trace"
|
||||
"github.com/jonboulle/clockwork"
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
saml2 "github.com/russellhaering/gosaml2"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
@ -731,7 +731,7 @@ func (a *Server) GenerateUserAppTestCert(req AppTestCertRequest) ([]byte, error)
|
|||
}
|
||||
sessionID := req.SessionID
|
||||
if sessionID == "" {
|
||||
sessionID = uuid.New()
|
||||
sessionID = uuid.New().String()
|
||||
}
|
||||
certs, err := a.generateUserCert(certRequest{
|
||||
user: user,
|
||||
|
@ -742,7 +742,7 @@ func (a *Server) GenerateUserAppTestCert(req AppTestCertRequest) ([]byte, error)
|
|||
// used to log into servers but SSH certificate generation code requires a
|
||||
// principal be in the certificate.
|
||||
traits: wrappers.Traits(map[string][]string{
|
||||
teleport.TraitLogins: {uuid.New()},
|
||||
teleport.TraitLogins: {uuid.New().String()},
|
||||
}),
|
||||
// Only allow this certificate to be used for applications.
|
||||
usage: []string{teleport.UsageAppsOnly},
|
||||
|
|
|
@ -59,8 +59,8 @@ import (
|
|||
"github.com/gravitational/trace"
|
||||
|
||||
"github.com/coreos/go-oidc/jose"
|
||||
"github.com/google/uuid"
|
||||
"github.com/jonboulle/clockwork"
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/stretchr/testify/require"
|
||||
. "gopkg.in/check.v1"
|
||||
)
|
||||
|
@ -1179,7 +1179,7 @@ func TestGenerateHostCertWithLocks(t *testing.T) {
|
|||
p, err := newTestPack(ctx, t.TempDir())
|
||||
require.NoError(t, err)
|
||||
|
||||
hostID := uuid.New()
|
||||
hostID := uuid.New().String()
|
||||
keygen := testauthority.New()
|
||||
_, pub, err := keygen.GetNewKeyPairFromPool()
|
||||
require.NoError(t, err)
|
||||
|
|
|
@ -36,8 +36,8 @@ import (
|
|||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"github.com/google/go-cmp/cmp/cmpopts"
|
||||
"github.com/google/uuid"
|
||||
"github.com/gravitational/trace"
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
|
@ -592,7 +592,7 @@ func TestListNodes(t *testing.T) {
|
|||
|
||||
// Create test nodes.
|
||||
for i := 0; i < 10; i++ {
|
||||
name := uuid.New()
|
||||
name := uuid.New().String()
|
||||
node, err := types.NewServerWithLabels(
|
||||
name,
|
||||
types.KindNode,
|
||||
|
@ -851,7 +851,7 @@ func TestGetDatabaseServers(t *testing.T) {
|
|||
|
||||
// Create test databases.
|
||||
for i := 0; i < 5; i++ {
|
||||
name := uuid.New()
|
||||
name := uuid.New().String()
|
||||
db, err := types.NewDatabaseServerV3(types.Metadata{
|
||||
Name: name,
|
||||
Labels: map[string]string{"name": name},
|
||||
|
@ -1039,7 +1039,7 @@ func TestGetAppServers(t *testing.T) {
|
|||
|
||||
// Create test apps.
|
||||
for i := 0; i < 5; i++ {
|
||||
name := uuid.New()
|
||||
name := uuid.New().String()
|
||||
app, err := types.NewServerWithLabels(
|
||||
name,
|
||||
types.KindAppServer,
|
||||
|
|
|
@ -26,9 +26,9 @@ import (
|
|||
|
||||
"github.com/coreos/go-semver/semver"
|
||||
"github.com/golang/protobuf/ptypes/empty"
|
||||
"github.com/google/uuid"
|
||||
"github.com/gravitational/trace"
|
||||
"github.com/gravitational/trace/trail"
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/sirupsen/logrus"
|
||||
"google.golang.org/grpc"
|
||||
|
@ -232,7 +232,7 @@ func (g *GRPCServer) CreateAuditStream(stream proto.AuthService_CreateAuditStrea
|
|||
Metadata: apievents.Metadata{
|
||||
Type: events.SessionUploadEvent,
|
||||
Code: events.SessionUploadCode,
|
||||
ID: uuid.New(),
|
||||
ID: uuid.New().String(),
|
||||
Index: events.SessionUploadIndex,
|
||||
ClusterName: clusterName.GetClusterName(),
|
||||
},
|
||||
|
|
|
@ -28,6 +28,7 @@ import (
|
|||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"github.com/google/go-cmp/cmp/cmpopts"
|
||||
"github.com/google/uuid"
|
||||
"github.com/gravitational/teleport"
|
||||
"github.com/gravitational/teleport/api/client/proto"
|
||||
"github.com/gravitational/teleport/api/constants"
|
||||
|
@ -45,7 +46,6 @@ import (
|
|||
"github.com/gravitational/teleport/lib/tlsca"
|
||||
"github.com/gravitational/trace"
|
||||
"github.com/jonboulle/clockwork"
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/pquerna/otp"
|
||||
"github.com/pquerna/otp/totp"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
@ -2093,7 +2093,7 @@ func TestListResources(t *testing.T) {
|
|||
Protocol: defaults.ProtocolPostgres,
|
||||
URI: "localhost:5432",
|
||||
Hostname: "localhost",
|
||||
HostID: uuid.New(),
|
||||
HostID: uuid.New().String(),
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -2119,7 +2119,7 @@ func TestListResources(t *testing.T) {
|
|||
Name: name,
|
||||
}, types.AppServerSpecV3{
|
||||
Hostname: "localhost",
|
||||
HostID: uuid.New(),
|
||||
HostID: uuid.New().String(),
|
||||
App: app,
|
||||
})
|
||||
if err != nil {
|
||||
|
|
|
@ -39,9 +39,9 @@ import (
|
|||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"github.com/google/go-cmp/cmp/cmpopts"
|
||||
"github.com/google/uuid"
|
||||
"github.com/gravitational/trace"
|
||||
"github.com/jonboulle/clockwork"
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/stretchr/testify/require"
|
||||
"golang.org/x/crypto/ssh"
|
||||
kyaml "k8s.io/apimachinery/pkg/util/yaml"
|
||||
|
@ -911,7 +911,7 @@ func TestIdentityChecker(t *testing.T) {
|
|||
|
||||
identity, err := GenerateIdentity(authServer, IdentityID{
|
||||
Role: types.RoleNode,
|
||||
HostUUID: uuid.New(),
|
||||
HostUUID: uuid.New().String(),
|
||||
NodeName: "node-1",
|
||||
}, nil, nil)
|
||||
require.NoError(t, err)
|
||||
|
|
|
@ -27,9 +27,9 @@ import (
|
|||
"github.com/gravitational/teleport/lib/tlsca"
|
||||
"github.com/gravitational/teleport/lib/utils"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/gravitational/trace"
|
||||
"github.com/jonboulle/clockwork"
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/sirupsen/logrus"
|
||||
"golang.org/x/crypto/ssh"
|
||||
)
|
||||
|
@ -468,7 +468,7 @@ func (a *Server) startNewRotation(req rotationReq, ca types.CertAuthority) error
|
|||
gracePeriod := req.gracePeriod
|
||||
|
||||
rotation := ca.GetRotation()
|
||||
id := uuid.New()
|
||||
id := uuid.New().String()
|
||||
|
||||
rotation.Mode = req.mode
|
||||
rotation.Schedule = req.schedule
|
||||
|
|
|
@ -29,9 +29,9 @@ import (
|
|||
"github.com/gravitational/teleport/lib/tlsca"
|
||||
"github.com/gravitational/teleport/lib/utils"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/gravitational/trace"
|
||||
"github.com/jonboulle/clockwork"
|
||||
"github.com/pborman/uuid"
|
||||
)
|
||||
|
||||
// CreateAppSession creates and inserts a services.WebSession into the
|
||||
|
@ -75,7 +75,7 @@ func (s *Server) CreateAppSession(ctx context.Context, req types.CreateAppSessio
|
|||
// Only allow this certificate to be used for applications.
|
||||
usage: []string{teleport.UsageAppsOnly},
|
||||
// Add in the application routing information.
|
||||
appSessionID: uuid.New(),
|
||||
appSessionID: uuid.New().String(),
|
||||
appPublicAddr: req.PublicAddr,
|
||||
appClusterName: req.ClusterName,
|
||||
awsRoleARN: req.AWSRoleARN,
|
||||
|
|
|
@ -21,9 +21,9 @@ import (
|
|||
"crypto/x509"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/gravitational/teleport/api/types"
|
||||
"github.com/gravitational/trace"
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/tstranex/u2f"
|
||||
)
|
||||
|
||||
|
@ -37,7 +37,7 @@ type DeviceStorage interface {
|
|||
// This function is not in lib/services due to an import cycle (lib/services
|
||||
// depends on lib/auth/u2f).
|
||||
func NewDevice(name string, reg *Registration, addedAt time.Time) (*types.MFADevice, error) {
|
||||
d := types.NewMFADevice(name, uuid.New(), addedAt)
|
||||
d := types.NewMFADevice(name, uuid.New().String(), addedAt)
|
||||
pubKey, err := x509.MarshalPKIXPublicKey(®.PubKey)
|
||||
if err != nil {
|
||||
return nil, trace.Wrap(err)
|
||||
|
|
|
@ -37,7 +37,7 @@ func getOrCreateUserWebauthnID(ctx context.Context, user string, identity userID
|
|||
wla, err := identity.GetWebauthnLocalAuth(ctx, user)
|
||||
switch {
|
||||
case trace.IsNotFound(err): // first-time user, create a new ID
|
||||
webID := uuid.New()
|
||||
webID := []byte(uuid.New().String())
|
||||
err := identity.UpsertWebauthnLocalAuth(ctx, user, &types.WebauthnLocalAuth{
|
||||
UserID: webID[:],
|
||||
})
|
||||
|
|
|
@ -29,7 +29,7 @@ import (
|
|||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/service/applicationautoscaling"
|
||||
"github.com/aws/aws-sdk-go/service/dynamodb"
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/google/uuid"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
|
|
|
@ -33,8 +33,8 @@ import (
|
|||
|
||||
"github.com/gravitational/trace"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/jonboulle/clockwork"
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
|
@ -987,7 +987,7 @@ func requireWaitGroupToFinish(ctx context.Context, t *testing.T, waitGroup *sync
|
|||
// MakePrefix returns function that appends unique prefix
|
||||
// to any key, used to make test suite concurrent-run proof
|
||||
func MakePrefix() func(k string) []byte {
|
||||
id := "/" + uuid.New()
|
||||
id := "/" + uuid.New().String()
|
||||
return func(k string) []byte {
|
||||
return []byte(id + k)
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ import (
|
|||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/testutil"
|
||||
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/google/uuid"
|
||||
"gopkg.in/check.v1"
|
||||
)
|
||||
|
||||
|
@ -87,8 +87,8 @@ func (s *Suite) TestWatch(c *check.C) {
|
|||
// have PID 1, so nothing should be captured in the Audit Log.
|
||||
cgroupID, err := service.OpenSession(&SessionContext{
|
||||
Namespace: apidefaults.Namespace,
|
||||
SessionID: uuid.New(),
|
||||
ServerID: uuid.New(),
|
||||
SessionID: uuid.New().String(),
|
||||
ServerID: uuid.New().String(),
|
||||
Login: "foo",
|
||||
User: "foo@example.com",
|
||||
PID: cmd.Process.Pid,
|
||||
|
|
12
lib/cache/cache_test.go
vendored
12
lib/cache/cache_test.go
vendored
|
@ -40,8 +40,8 @@ import (
|
|||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"github.com/google/go-cmp/cmp/cmpopts"
|
||||
"github.com/google/uuid"
|
||||
"github.com/jonboulle/clockwork"
|
||||
"github.com/pborman/uuid"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
@ -628,7 +628,7 @@ func benchGetNodes(b *testing.B, nodeCount int) {
|
|||
|
||||
for i := 0; i < nodeCount; i++ {
|
||||
func() {
|
||||
server := suite.NewServer(types.KindNode, uuid.New(), "127.0.0.1:2022", apidefaults.Namespace)
|
||||
server := suite.NewServer(types.KindNode, uuid.New().String(), "127.0.0.1:2022", apidefaults.Namespace)
|
||||
_, err := p.presenceS.UpsertNode(ctx, server)
|
||||
require.NoError(b, err)
|
||||
timeout := time.NewTimer(time.Millisecond * 200)
|
||||
|
@ -671,7 +671,7 @@ func benchListNodes(b *testing.B, nodeCount int, pageSize int) {
|
|||
|
||||
for i := 0; i < nodeCount; i++ {
|
||||
func() {
|
||||
server := suite.NewServer(types.KindNode, uuid.New(), "127.0.0.1:2022", apidefaults.Namespace)
|
||||
server := suite.NewServer(types.KindNode, uuid.New().String(), "127.0.0.1:2022", apidefaults.Namespace)
|
||||
_, err := p.presenceS.UpsertNode(ctx, server)
|
||||
require.NoError(b, err)
|
||||
timeout := time.NewTimer(time.Millisecond * 200)
|
||||
|
@ -745,7 +745,7 @@ func TestListNodesTTLVariant(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
|
||||
for i := 0; i < nodeCount; i++ {
|
||||
server := suite.NewServer(types.KindNode, uuid.New(), "127.0.0.1:2022", apidefaults.Namespace)
|
||||
server := suite.NewServer(types.KindNode, uuid.New().String(), "127.0.0.1:2022", apidefaults.Namespace)
|
||||
_, err := p.presenceS.UpsertNode(ctx, server)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
@ -1837,7 +1837,7 @@ func TestApplicationServers(t *testing.T) {
|
|||
// Upsert app server into backend.
|
||||
app, err := types.NewAppV3(types.Metadata{Name: "app"}, types.AppSpecV3{URI: "localhost"})
|
||||
require.NoError(t, err)
|
||||
server, err := types.NewAppServerV3FromApp(app, "host", uuid.New())
|
||||
server, err := types.NewAppServerV3FromApp(app, "host", uuid.New().String())
|
||||
require.NoError(t, err)
|
||||
|
||||
_, err = p.presenceS.UpsertApplicationServer(ctx, server)
|
||||
|
@ -2007,7 +2007,7 @@ func TestDatabaseServers(t *testing.T) {
|
|||
Protocol: defaults.ProtocolPostgres,
|
||||
URI: "localhost:5432",
|
||||
Hostname: "localhost",
|
||||
HostID: uuid.New(),
|
||||
HostID: uuid.New().String(),
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ import (
|
|||
|
||||
"github.com/gravitational/trace"
|
||||
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/google/uuid"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
|
@ -83,7 +83,7 @@ func New(config *Config) (*Service, error) {
|
|||
|
||||
s := &Service{
|
||||
Config: config,
|
||||
teleportRoot: path.Join(config.MountPath, teleportRoot, uuid.New()),
|
||||
teleportRoot: path.Join(config.MountPath, teleportRoot, uuid.New().String()),
|
||||
}
|
||||
|
||||
// Mount the cgroup2 filesystem.
|
||||
|
@ -213,7 +213,7 @@ func (s *Service) cleanupHierarchy() error {
|
|||
var sessions []string
|
||||
|
||||
// Recursively look within the Teleport hierarchy for cgroups for session.
|
||||
err := filepath.Walk(path.Join(s.teleportRoot), func(path string, info os.FileInfo, err error) error {
|
||||
err := filepath.Walk(path.Join(s.teleportRoot), func(path string, info os.FileInfo, _ error) error {
|
||||
// Only pick up cgroup.procs files.
|
||||
if !pattern.MatchString(path) {
|
||||
return nil
|
||||
|
@ -224,8 +224,8 @@ func (s *Service) cleanupHierarchy() error {
|
|||
if len(parts) != 5 {
|
||||
return nil
|
||||
}
|
||||
sessionID := uuid.Parse(parts[3])
|
||||
if sessionID == nil {
|
||||
sessionID, err := uuid.Parse(parts[3])
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ import (
|
|||
|
||||
"github.com/gravitational/teleport/lib/utils"
|
||||
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/google/uuid"
|
||||
"gopkg.in/check.v1"
|
||||
)
|
||||
|
||||
|
@ -62,7 +62,7 @@ func (s *Suite) TestCreate(c *check.C) {
|
|||
c.Assert(err, check.IsNil)
|
||||
|
||||
// Create fake session ID and cgroup.
|
||||
sessionID := uuid.New()
|
||||
sessionID := uuid.New().String()
|
||||
err = service.Create(sessionID)
|
||||
c.Assert(err, check.IsNil)
|
||||
|
||||
|
@ -115,7 +115,7 @@ func (s *Suite) TestCleanup(c *check.C) {
|
|||
defer service.Close()
|
||||
|
||||
// Create fake session ID and cgroup.
|
||||
sessionID := uuid.New()
|
||||
sessionID := uuid.New().String()
|
||||
err = service.Create(sessionID)
|
||||
c.Assert(err, check.IsNil)
|
||||
|
||||
|
|
|
@ -28,8 +28,8 @@ import (
|
|||
"github.com/gravitational/teleport/lib/secret"
|
||||
"github.com/gravitational/teleport/lib/utils"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/gravitational/trace"
|
||||
"github.com/pborman/uuid"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -100,7 +100,7 @@ func NewRedirector(ctx context.Context, login SSHLoginSSO) (*Redirector, error)
|
|||
SSHLoginSSO: login,
|
||||
mux: http.NewServeMux(),
|
||||
key: key,
|
||||
shortPath: "/" + uuid.New(),
|
||||
shortPath: "/" + uuid.New().String(),
|
||||
responseC: make(chan *auth.SSHLoginResponse, 1),
|
||||
errorC: make(chan error, 1),
|
||||
}
|
||||
|
|
|
@ -30,8 +30,8 @@ import (
|
|||
|
||||
"github.com/gravitational/trace"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/jonboulle/clockwork"
|
||||
"github.com/pborman/uuid"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
|
@ -155,7 +155,7 @@ func (u *UploadCompleter) CheckUploads(ctx context.Context) error {
|
|||
Metadata: apievents.Metadata{
|
||||
Type: SessionUploadEvent,
|
||||
Code: SessionUploadCode,
|
||||
ID: uuid.New(),
|
||||
ID: uuid.New().String(),
|
||||
Index: SessionUploadIndex,
|
||||
},
|
||||
SessionMetadata: apievents.SessionMetadata{
|
||||
|
|
|
@ -46,9 +46,9 @@ import (
|
|||
"github.com/aws/aws-sdk-go/service/applicationautoscaling"
|
||||
"github.com/aws/aws-sdk-go/service/dynamodb"
|
||||
"github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute"
|
||||
"github.com/google/uuid"
|
||||
"github.com/gravitational/trace"
|
||||
"github.com/jonboulle/clockwork"
|
||||
"github.com/pborman/uuid"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"go.uber.org/atomic"
|
||||
)
|
||||
|
@ -505,7 +505,7 @@ func (l *Log) EmitAuditEvent(ctx context.Context, in apievents.AuditEvent) error
|
|||
} else {
|
||||
// no session id - global event gets a random uuid to get a good partition
|
||||
// key distribution
|
||||
sessionID = uuid.New()
|
||||
sessionID = uuid.New().String()
|
||||
}
|
||||
|
||||
fieldsMap, err := events.ToEventFields(in)
|
||||
|
@ -546,7 +546,7 @@ func (l *Log) EmitAuditEventLegacy(ev events.Event, fields events.EventFields) e
|
|||
// no session id - global event gets a random uuid to get a good partition
|
||||
// key distribution
|
||||
if sessionID == "" {
|
||||
sessionID = uuid.New()
|
||||
sessionID = uuid.New().String()
|
||||
}
|
||||
err := events.UpdateEventFields(ev, fields, l.Clock, l.UIDGenerator)
|
||||
if err != nil {
|
||||
|
|
|
@ -40,8 +40,8 @@ import (
|
|||
"github.com/gravitational/teleport/lib/utils"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/jonboulle/clockwork"
|
||||
"github.com/pborman/uuid"
|
||||
"gopkg.in/check.v1"
|
||||
|
||||
"github.com/gravitational/trace"
|
||||
|
@ -73,7 +73,7 @@ func (s *suiteBase) SetUpSuite(c *check.C) {
|
|||
fakeClock := clockwork.NewFakeClock()
|
||||
log, err := New(context.Background(), Config{
|
||||
Region: "eu-north-1",
|
||||
Tablename: fmt.Sprintf("teleport-test-%v", uuid.New()),
|
||||
Tablename: fmt.Sprintf("teleport-test-%v", uuid.New().String()),
|
||||
Clock: fakeClock,
|
||||
UIDGenerator: utils.NewFakeUID(),
|
||||
}, backend)
|
||||
|
@ -184,7 +184,7 @@ func TestDateRangeGenerator(t *testing.T) {
|
|||
|
||||
func (s *DynamoeventsSuite) TestRFD24Migration(c *check.C) {
|
||||
eventTemplate := preRFD24event{
|
||||
SessionID: uuid.New(),
|
||||
SessionID: uuid.New().String(),
|
||||
EventIndex: -1,
|
||||
EventType: "test.event",
|
||||
Fields: "{}",
|
||||
|
@ -231,7 +231,7 @@ type preRFD24event struct {
|
|||
func (s *DynamoeventsSuite) TestFieldsMapMigration(c *check.C) {
|
||||
ctx := context.Background()
|
||||
eventTemplate := eventWithJSONFields{
|
||||
SessionID: uuid.New(),
|
||||
SessionID: uuid.New().String(),
|
||||
EventIndex: -1,
|
||||
EventType: "test.event",
|
||||
Fields: "{}",
|
||||
|
|
|
@ -32,8 +32,8 @@ import (
|
|||
"github.com/gravitational/teleport/lib/session"
|
||||
"github.com/gravitational/teleport/lib/utils"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/gravitational/trace"
|
||||
"github.com/pborman/uuid"
|
||||
)
|
||||
|
||||
// NewStreamer creates a streamer sending uploads to disk
|
||||
|
@ -58,7 +58,7 @@ func (h *Handler) CreateUpload(ctx context.Context, sessionID session.ID) (*even
|
|||
|
||||
upload := events.StreamUpload{
|
||||
SessionID: sessionID,
|
||||
ID: uuid.New(),
|
||||
ID: uuid.New().String(),
|
||||
}
|
||||
if err := upload.CheckAndSetDefaults(); err != nil {
|
||||
return nil, trace.Wrap(err)
|
||||
|
@ -312,9 +312,9 @@ func checkUpload(upload events.StreamUpload) error {
|
|||
// checkUploadID checks that upload ID is a valid UUID
|
||||
// to avoid path scanning or using local paths as upload IDs
|
||||
func checkUploadID(uploadID string) error {
|
||||
out := uuid.Parse(uploadID)
|
||||
if out == nil {
|
||||
return trace.BadParameter("bad format of upload ID")
|
||||
_, err := uuid.Parse(uploadID)
|
||||
if err != nil {
|
||||
return trace.WrapWithMessage(err, "bad format of upload ID")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -43,9 +43,9 @@ import (
|
|||
|
||||
apiv1 "cloud.google.com/go/firestore/apiv1/admin"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/gravitational/trace"
|
||||
"github.com/jonboulle/clockwork"
|
||||
"github.com/pborman/uuid"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
|
@ -324,7 +324,7 @@ func (l *Log) EmitAuditEvent(ctx context.Context, in apievents.AuditEvent) error
|
|||
} else {
|
||||
// no session id - global event gets a random uuid to get a good partition
|
||||
// key distribution
|
||||
sessionID = uuid.New()
|
||||
sessionID = uuid.New().String()
|
||||
}
|
||||
|
||||
event := event{
|
||||
|
@ -352,7 +352,7 @@ func (l *Log) EmitAuditEventLegacy(ev events.Event, fields events.EventFields) e
|
|||
// no session id - global event gets a random uuid to get a good partition
|
||||
// key distribution
|
||||
if sessionID == "" {
|
||||
sessionID = uuid.New()
|
||||
sessionID = uuid.New().String()
|
||||
}
|
||||
err := events.UpdateEventFields(ev, fields, l.Clock, l.UIDGenerator)
|
||||
if err != nil {
|
||||
|
@ -692,7 +692,7 @@ func (l *Log) Close() error {
|
|||
}
|
||||
|
||||
func (l *Log) getDocIDForEvent(event event) string {
|
||||
return uuid.New()
|
||||
return uuid.New().String()
|
||||
}
|
||||
|
||||
func (l *Log) purgeExpiredEvents() error {
|
||||
|
|
|
@ -24,7 +24,7 @@ import (
|
|||
"github.com/gravitational/teleport/lib/utils"
|
||||
|
||||
"github.com/fsouza/fake-gcs-server/fakestorage"
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/google/uuid"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
|
@ -44,7 +44,7 @@ func TestFakeStreams(t *testing.T) {
|
|||
|
||||
handler, err := NewHandler(ctx, cancelFunc, Config{
|
||||
Endpoint: server.URL(),
|
||||
Bucket: fmt.Sprintf("teleport-test-%v", uuid.New()),
|
||||
Bucket: fmt.Sprintf("teleport-test-%v", uuid.New().String()),
|
||||
}, server.Client())
|
||||
require.Nil(t, err)
|
||||
defer handler.Close()
|
||||
|
|
|
@ -32,7 +32,7 @@ import (
|
|||
"github.com/gravitational/teleport/lib/session"
|
||||
|
||||
"cloud.google.com/go/storage"
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/google/uuid"
|
||||
"google.golang.org/api/iterator"
|
||||
|
||||
"github.com/gravitational/trace"
|
||||
|
@ -41,7 +41,7 @@ import (
|
|||
// CreateUpload creates a multipart upload
|
||||
func (h *Handler) CreateUpload(ctx context.Context, sessionID session.ID) (*events.StreamUpload, error) {
|
||||
upload := events.StreamUpload{
|
||||
ID: uuid.New(),
|
||||
ID: uuid.New().String(),
|
||||
SessionID: sessionID,
|
||||
Initiated: time.Now().UTC(),
|
||||
}
|
||||
|
|
|
@ -20,9 +20,9 @@ import (
|
|||
"bytes"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
apievents "github.com/gravitational/teleport/api/types/events"
|
||||
"github.com/jonboulle/clockwork"
|
||||
"github.com/pborman/uuid"
|
||||
)
|
||||
|
||||
// SessionParams specifies optional parameters
|
||||
|
@ -48,10 +48,10 @@ func (p *SessionParams) SetDefaults() {
|
|||
time.Date(2020, 03, 30, 15, 58, 54, 561*int(time.Millisecond), time.UTC))
|
||||
}
|
||||
if p.ServerID == "" {
|
||||
p.ServerID = uuid.New()
|
||||
p.ServerID = uuid.New().String()
|
||||
}
|
||||
if p.SessionID == "" {
|
||||
p.SessionID = uuid.New()
|
||||
p.SessionID = uuid.New().String()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -26,9 +26,9 @@ import (
|
|||
"github.com/gravitational/teleport/lib/events/test"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws/credentials"
|
||||
"github.com/google/uuid"
|
||||
"github.com/johannesboyne/gofakes3"
|
||||
"github.com/johannesboyne/gofakes3/backend/s3mem"
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/gravitational/trace"
|
||||
|
@ -46,7 +46,7 @@ func TestThirdpartyStreams(t *testing.T) {
|
|||
Credentials: credentials.NewStaticCredentials("YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", ""),
|
||||
Region: "us-west-1",
|
||||
Path: "/test/",
|
||||
Bucket: fmt.Sprintf("teleport-test-%v", uuid.New()),
|
||||
Bucket: fmt.Sprintf("teleport-test-%v", uuid.New().String()),
|
||||
Endpoint: server.URL,
|
||||
DisableServerSideEncryption: true,
|
||||
})
|
||||
|
|
|
@ -32,9 +32,9 @@ import (
|
|||
"github.com/gravitational/teleport/lib/session"
|
||||
"github.com/gravitational/teleport/lib/utils"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/gravitational/trace"
|
||||
"github.com/jonboulle/clockwork"
|
||||
"github.com/pborman/uuid"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
|
@ -415,7 +415,7 @@ func EventFromChunk(sessionID string, chunk *SessionChunk) (EventFields, error)
|
|||
fields[EventTime] = eventStart
|
||||
fields[EventType] = chunk.EventType
|
||||
if fields[EventID] == "" {
|
||||
fields[EventID] = uuid.New()
|
||||
fields[EventID] = uuid.New().String()
|
||||
}
|
||||
return fields, nil
|
||||
}
|
||||
|
|
|
@ -32,9 +32,9 @@ import (
|
|||
"github.com/gravitational/teleport/lib/session"
|
||||
"github.com/gravitational/teleport/lib/utils"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/gravitational/trace"
|
||||
"github.com/jonboulle/clockwork"
|
||||
"github.com/pborman/uuid"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"go.uber.org/atomic"
|
||||
)
|
||||
|
@ -1111,7 +1111,7 @@ func (m *MemoryUploader) CreateUpload(ctx context.Context, sessionID session.ID)
|
|||
m.mtx.Lock()
|
||||
defer m.mtx.Unlock()
|
||||
upload := &StreamUpload{
|
||||
ID: uuid.New(),
|
||||
ID: uuid.New().String(),
|
||||
SessionID: sessionID,
|
||||
}
|
||||
m.uploads[upload.ID] = &MemoryUpload{
|
||||
|
|
|
@ -26,7 +26,7 @@ import (
|
|||
"github.com/gravitational/teleport/api/types"
|
||||
"github.com/gravitational/teleport/lib/utils"
|
||||
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/google/uuid"
|
||||
"gopkg.in/check.v1"
|
||||
)
|
||||
|
||||
|
@ -92,7 +92,7 @@ func (s *LabelSuite) TestInvalidCommand(c *check.C) {
|
|||
Labels: map[string]types.CommandLabel{
|
||||
"foo": &types.CommandLabelV2{
|
||||
Period: types.NewDuration(1 * time.Second),
|
||||
Command: []string{uuid.New()}},
|
||||
Command: []string{uuid.New().String()}},
|
||||
},
|
||||
})
|
||||
c.Assert(err, check.IsNil)
|
||||
|
|
|
@ -39,7 +39,7 @@ import (
|
|||
"github.com/gravitational/teleport/lib/services"
|
||||
"github.com/gravitational/teleport/lib/utils"
|
||||
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/google/uuid"
|
||||
"gopkg.in/check.v1"
|
||||
)
|
||||
|
||||
|
@ -199,8 +199,8 @@ func (s *Suite) SetUpSuite(c *check.C) {
|
|||
// Create the SessionContext used by both enhanced recording and us (restricted session)
|
||||
s.ctx = &bpf.SessionContext{
|
||||
Namespace: apidefaults.Namespace,
|
||||
SessionID: uuid.New(),
|
||||
ServerID: uuid.New(),
|
||||
SessionID: uuid.New().String(),
|
||||
ServerID: uuid.New().String(),
|
||||
Login: "foo",
|
||||
User: "foo@example.com",
|
||||
PID: os.Getpid(),
|
||||
|
|
|
@ -91,9 +91,9 @@ import (
|
|||
"github.com/gravitational/teleport/lib/utils"
|
||||
"github.com/gravitational/teleport/lib/web"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/gravitational/roundtrip"
|
||||
"github.com/jonboulle/clockwork"
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
@ -647,7 +647,7 @@ func NewTeleport(cfg *Config) (*TeleportProcess, error) {
|
|||
} else {
|
||||
switch cfg.JoinMethod {
|
||||
case JoinMethodToken:
|
||||
cfg.HostUUID = uuid.New()
|
||||
cfg.HostUUID = uuid.New().String()
|
||||
case JoinMethodEC2:
|
||||
cfg.HostUUID, err = utils.GetEC2NodeID()
|
||||
if err != nil {
|
||||
|
@ -663,7 +663,8 @@ func NewTeleport(cfg *Config) (*TeleportProcess, error) {
|
|||
}
|
||||
}
|
||||
|
||||
if uuid.Parse(cfg.HostUUID) == nil {
|
||||
_, err = uuid.Parse(cfg.HostUUID)
|
||||
if err != nil {
|
||||
cfg.Log.Warnf("Host UUID %q is not a true UUID (not eligible for UUID-based proxying)", cfg.HostUUID)
|
||||
}
|
||||
|
||||
|
|
|
@ -27,8 +27,8 @@ import (
|
|||
"github.com/gravitational/teleport/lib/utils"
|
||||
"github.com/gravitational/teleport/lib/utils/parse"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/gravitational/trace"
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/vulcand/predicate"
|
||||
)
|
||||
|
||||
|
@ -37,7 +37,8 @@ func ValidateAccessRequest(ar types.AccessRequest) error {
|
|||
if err := ar.CheckAndSetDefaults(); err != nil {
|
||||
return trace.Wrap(err)
|
||||
}
|
||||
if uuid.Parse(ar.GetName()) == nil {
|
||||
_, err := uuid.Parse(ar.GetName())
|
||||
if err != nil {
|
||||
return trace.BadParameter("invalid access request id %q", ar.GetName())
|
||||
}
|
||||
return nil
|
||||
|
@ -45,7 +46,7 @@ func ValidateAccessRequest(ar types.AccessRequest) error {
|
|||
|
||||
// NewAccessRequest assembles an AccessRequest resource.
|
||||
func NewAccessRequest(user string, roles ...string) (types.AccessRequest, error) {
|
||||
req, err := types.NewAccessRequest(uuid.New(), user, roles...)
|
||||
req, err := types.NewAccessRequest(uuid.New().String(), user, roles...)
|
||||
if err != nil {
|
||||
return nil, trace.Wrap(err)
|
||||
}
|
||||
|
@ -77,7 +78,8 @@ func (r *RequestIDs) Unmarshal(data []byte) error {
|
|||
|
||||
func (r *RequestIDs) Check() error {
|
||||
for _, id := range r.AccessRequests {
|
||||
if uuid.Parse(id) == nil {
|
||||
_, err := uuid.Parse(id)
|
||||
if err != nil {
|
||||
return trace.BadParameter("invalid request id %q", id)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,8 +24,8 @@ import (
|
|||
"github.com/gravitational/teleport/lib/fixtures"
|
||||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"github.com/google/uuid"
|
||||
"github.com/gravitational/trace"
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
|
@ -37,7 +37,7 @@ type mockUserAndRoleGetter struct {
|
|||
|
||||
// user inserts a new user with the specified roles and returns the username.
|
||||
func (m *mockUserAndRoleGetter) user(t *testing.T, roles ...string) string {
|
||||
name := uuid.New()
|
||||
name := uuid.New().String()
|
||||
user, err := types.NewUser(name)
|
||||
require.NoError(t, err)
|
||||
|
||||
|
|
|
@ -26,8 +26,8 @@ import (
|
|||
"github.com/gravitational/teleport/lib/auth/u2f"
|
||||
"github.com/gravitational/teleport/lib/utils"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/gravitational/trace"
|
||||
"github.com/pborman/uuid"
|
||||
"golang.org/x/crypto/bcrypt"
|
||||
)
|
||||
|
||||
|
@ -58,7 +58,7 @@ func ValidateLocalAuthSecrets(l *types.LocalAuthSecrets) error {
|
|||
|
||||
// NewTOTPDevice creates a TOTP MFADevice from the given key.
|
||||
func NewTOTPDevice(name, key string, addedAt time.Time) (*types.MFADevice, error) {
|
||||
d := types.NewMFADevice(name, uuid.New(), addedAt)
|
||||
d := types.NewMFADevice(name, uuid.New().String(), addedAt)
|
||||
d.Device = &types.MFADevice_Totp{Totp: &types.TOTPDevice{
|
||||
Key: key,
|
||||
}}
|
||||
|
|
|
@ -22,14 +22,14 @@ import (
|
|||
"github.com/gravitational/teleport/api/types"
|
||||
"github.com/gravitational/teleport/lib/utils"
|
||||
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
// NewClusterNameWithRandomID creates a ClusterName, supplying a random
|
||||
// ClusterID if the field is not provided in spec.
|
||||
func NewClusterNameWithRandomID(spec types.ClusterNameSpecV2) (types.ClusterName, error) {
|
||||
if spec.ClusterID == "" {
|
||||
spec.ClusterID = uuid.New()
|
||||
spec.ClusterID = uuid.New().String()
|
||||
}
|
||||
return types.NewClusterName(spec)
|
||||
}
|
||||
|
|
|
@ -22,11 +22,11 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/gravitational/teleport/api/types"
|
||||
"github.com/gravitational/teleport/lib/defaults"
|
||||
"github.com/gravitational/teleport/lib/fixtures"
|
||||
"github.com/gravitational/teleport/lib/utils"
|
||||
"github.com/pborman/uuid"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/service/rds"
|
||||
|
@ -254,7 +254,7 @@ func TestIsRDSClusterSupported(t *testing.T) {
|
|||
cluster := &rds.DBCluster{
|
||||
DBClusterArn: aws.String("arn:aws:rds:us-east-1:1234567890:cluster:test"),
|
||||
DBClusterIdentifier: aws.String(test.name),
|
||||
DbClusterResourceId: aws.String(uuid.New()),
|
||||
DbClusterResourceId: aws.String(uuid.New().String()),
|
||||
Engine: aws.String(RDSEngineAuroraMySQL),
|
||||
EngineMode: aws.String(test.engineMode),
|
||||
EngineVersion: aws.String(test.engineVersion),
|
||||
|
|
|
@ -31,8 +31,8 @@ import (
|
|||
"github.com/gravitational/teleport/lib/services"
|
||||
"github.com/gravitational/teleport/lib/utils"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/gravitational/trace"
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
|
@ -818,7 +818,7 @@ func (s *PresenceService) AcquireSemaphore(ctx context.Context, req types.Acquir
|
|||
return nil, trace.BadParameter("cannot acquire expired semaphore lease")
|
||||
}
|
||||
|
||||
leaseID := uuid.New()
|
||||
leaseID := uuid.New().String()
|
||||
|
||||
// key is not modified, so allocate it once
|
||||
key := backend.Key(semaphoresPrefix, req.SemaphoreKind, req.SemaphoreName)
|
||||
|
|
|
@ -24,8 +24,8 @@ import (
|
|||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"github.com/google/go-cmp/cmp/cmpopts"
|
||||
"github.com/google/uuid"
|
||||
"github.com/jonboulle/clockwork"
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/stretchr/testify/require"
|
||||
"gopkg.in/check.v1"
|
||||
|
||||
|
@ -131,7 +131,7 @@ func TestApplicationServersCRUD(t *testing.T) {
|
|||
Name: appA.GetName(),
|
||||
}, types.AppServerSpecV3{
|
||||
Hostname: "localhost",
|
||||
HostID: uuid.New(),
|
||||
HostID: uuid.New().String(),
|
||||
App: appA,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
@ -140,7 +140,7 @@ func TestApplicationServersCRUD(t *testing.T) {
|
|||
appBLegacy := &types.App{Name: "b", URI: "http://localhost:8081"}
|
||||
appB, err := types.NewAppV3FromLegacyApp(appBLegacy)
|
||||
require.NoError(t, err)
|
||||
serverBLegacy, err := types.NewServer(uuid.New(), types.KindAppServer,
|
||||
serverBLegacy, err := types.NewServer(uuid.New().String(), types.KindAppServer,
|
||||
types.ServerSpecV2{
|
||||
Hostname: "localhost",
|
||||
Apps: []*types.App{appBLegacy},
|
||||
|
@ -229,7 +229,7 @@ func TestDatabaseServersCRUD(t *testing.T) {
|
|||
Protocol: defaults.ProtocolPostgres,
|
||||
URI: "localhost:5432",
|
||||
Hostname: "localhost",
|
||||
HostID: uuid.New(),
|
||||
HostID: uuid.New().String(),
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
|
@ -456,7 +456,7 @@ func TestListResources(t *testing.T) {
|
|||
Protocol: defaults.ProtocolPostgres,
|
||||
URI: "localhost:5432",
|
||||
Hostname: "localhost",
|
||||
HostID: uuid.New(),
|
||||
HostID: uuid.New().String(),
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -509,7 +509,7 @@ func TestListResources(t *testing.T) {
|
|||
Name: name,
|
||||
}, types.AppServerSpecV3{
|
||||
Hostname: "localhost",
|
||||
HostID: uuid.New(),
|
||||
HostID: uuid.New().String(),
|
||||
App: app,
|
||||
})
|
||||
if err != nil {
|
||||
|
|
|
@ -25,6 +25,7 @@ import (
|
|||
|
||||
"github.com/gokyle/hotp"
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"github.com/google/uuid"
|
||||
"github.com/gravitational/teleport/api/types"
|
||||
wantypes "github.com/gravitational/teleport/api/types/webauthn"
|
||||
"github.com/gravitational/teleport/lib/auth/u2f"
|
||||
|
@ -32,7 +33,6 @@ import (
|
|||
"github.com/gravitational/teleport/lib/defaults"
|
||||
"github.com/gravitational/teleport/lib/services"
|
||||
"github.com/gravitational/trace"
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/sirupsen/logrus"
|
||||
"golang.org/x/crypto/bcrypt"
|
||||
)
|
||||
|
@ -468,7 +468,7 @@ func (s *IdentityService) AddUserLoginAttempt(user string, attempt services.Logi
|
|||
return trace.Wrap(err)
|
||||
}
|
||||
item := backend.Item{
|
||||
Key: backend.Key(webPrefix, usersPrefix, user, attemptsPrefix, uuid.New()),
|
||||
Key: backend.Key(webPrefix, usersPrefix, user, attemptsPrefix, uuid.New().String()),
|
||||
Value: value,
|
||||
Expires: backend.Expiry(s.Clock(), ttl),
|
||||
}
|
||||
|
@ -1257,7 +1257,7 @@ func (s *IdentityService) CreateUserRecoveryAttempt(ctx context.Context, user st
|
|||
}
|
||||
|
||||
item := backend.Item{
|
||||
Key: backend.Key(webPrefix, usersPrefix, user, recoveryAttemptsPrefix, uuid.New()),
|
||||
Key: backend.Key(webPrefix, usersPrefix, user, recoveryAttemptsPrefix, uuid.New().String()),
|
||||
Value: value,
|
||||
Expires: attempt.Expires,
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ import (
|
|||
"github.com/gravitational/teleport/api/types"
|
||||
"github.com/gravitational/teleport/lib/defaults"
|
||||
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/google/uuid"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
|
@ -48,8 +48,8 @@ func TestMatchResourceLabels(t *testing.T) {
|
|||
{Labels: types.Labels{types.Wildcard: []string{types.Wildcard}}},
|
||||
},
|
||||
databaseLabels: map[string]string{
|
||||
uuid.New(): uuid.New(),
|
||||
uuid.New(): uuid.New(),
|
||||
uuid.New().String(): uuid.New().String(),
|
||||
uuid.New().String(): uuid.New().String(),
|
||||
},
|
||||
match: true,
|
||||
},
|
||||
|
|
|
@ -23,7 +23,7 @@ import (
|
|||
apidefaults "github.com/gravitational/teleport/api/defaults"
|
||||
"github.com/gravitational/teleport/api/types"
|
||||
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
// NewPresetEditorRole returns a new pre-defined role for cluster
|
||||
|
@ -136,6 +136,6 @@ func NewPresetAuditorRole() types.Role {
|
|||
},
|
||||
},
|
||||
}
|
||||
role.SetLogins(types.Allow, []string{"no-login-" + uuid.New()})
|
||||
role.SetLogins(types.Allow, []string{"no-login-" + uuid.New().String()})
|
||||
return role
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ import (
|
|||
"github.com/gravitational/configure/cstrings"
|
||||
"github.com/gravitational/trace"
|
||||
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/google/uuid"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/vulcand/predicate"
|
||||
)
|
||||
|
@ -1138,7 +1138,7 @@ func (set RoleSet) CheckLoginDuration(ttl time.Duration) ([]string, error) {
|
|||
// but ssh certificates must contain at least one valid principal.
|
||||
// we add a single distinctive value which should be unique, and
|
||||
// will never be a valid unix login (due to leading '-').
|
||||
logins = []string{"-teleport-nologin-" + uuid.New()}
|
||||
logins = []string{"-teleport-nologin-" + uuid.New().String()}
|
||||
}
|
||||
|
||||
if len(logins) == 0 {
|
||||
|
@ -2227,7 +2227,7 @@ func DowngradeRoleToV3(r *types.RoleV4) (*types.RoleV4, error) {
|
|||
// empty. To prevent this for roles which are created as V4 and
|
||||
// downgraded, set a placeholder label
|
||||
const labelKey = "__teleport_no_labels"
|
||||
labelVal := uuid.New()
|
||||
labelVal := uuid.New().String()
|
||||
if len(r.Spec.Allow.NodeLabels) == 0 {
|
||||
downgraded.Spec.Allow.NodeLabels = types.Labels{labelKey: []string{labelVal}}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ import (
|
|||
"github.com/gravitational/teleport/lib/tlsca"
|
||||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/google/uuid"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/gravitational/trace"
|
||||
|
@ -3322,7 +3322,7 @@ func BenchmarkCheckAccessToServer(b *testing.B) {
|
|||
|
||||
// Create 4,000 servers with random IDs.
|
||||
for i := 0; i < 4000; i++ {
|
||||
hostname := uuid.NewUUID().String()
|
||||
hostname := uuid.New().String()
|
||||
servers = append(servers, &types.ServerV2{
|
||||
Kind: types.KindNode,
|
||||
Version: types.V2,
|
||||
|
@ -3413,7 +3413,7 @@ func TestRoleSetLockingMode(t *testing.T) {
|
|||
|
||||
missingMode := constants.LockingMode("")
|
||||
newRoleWithLockingMode := func(t *testing.T, mode constants.LockingMode) types.Role {
|
||||
role, err := types.NewRole(uuid.New(), types.RoleSpecV4{Options: types.RoleOptions{Lock: mode}})
|
||||
role, err := types.NewRole(uuid.New().String(), types.RoleSpecV4{Options: types.RoleOptions{Lock: mode}})
|
||||
require.NoError(t, err)
|
||||
return role
|
||||
}
|
||||
|
@ -3452,14 +3452,14 @@ func TestExtractConditionForIdentifier(t *testing.T) {
|
|||
require.True(t, trace.IsAccessDenied(err))
|
||||
|
||||
allowWhere := func(where string) types.Role {
|
||||
role, err := types.NewRole(uuid.New(), types.RoleSpecV4{Allow: types.RoleConditions{
|
||||
role, err := types.NewRole(uuid.New().String(), types.RoleSpecV4{Allow: types.RoleConditions{
|
||||
Rules: []types.Rule{{Resources: []string{types.KindSession}, Verbs: []string{types.VerbList}, Where: where}},
|
||||
}})
|
||||
require.NoError(t, err)
|
||||
return role
|
||||
}
|
||||
denyWhere := func(where string) types.Role {
|
||||
role, err := types.NewRole(uuid.New(), types.RoleSpecV4{Deny: types.RoleConditions{
|
||||
role, err := types.NewRole(uuid.New().String(), types.RoleSpecV4{Deny: types.RoleConditions{
|
||||
Rules: []types.Rule{{Resources: []string{types.KindSession}, Verbs: []string{types.VerbList}, Where: where}},
|
||||
}})
|
||||
require.NoError(t, err)
|
||||
|
|
|
@ -28,6 +28,7 @@ import (
|
|||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/gravitational/teleport"
|
||||
"github.com/gravitational/teleport/api/constants"
|
||||
apidefaults "github.com/gravitational/teleport/api/defaults"
|
||||
|
@ -40,7 +41,6 @@ import (
|
|||
"github.com/gravitational/teleport/lib/tlsca"
|
||||
"github.com/gravitational/trace"
|
||||
"github.com/jonboulle/clockwork"
|
||||
"github.com/pborman/uuid"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"golang.org/x/crypto/ssh"
|
||||
"gopkg.in/check.v1"
|
||||
|
@ -447,7 +447,7 @@ func NewAppServer(name string, internalAddr string, publicAddr string) *types.Se
|
|||
Kind: types.KindAppServer,
|
||||
Version: types.V2,
|
||||
Metadata: types.Metadata{
|
||||
Name: uuid.New(),
|
||||
Name: uuid.New().String(),
|
||||
Namespace: apidefaults.Namespace,
|
||||
},
|
||||
Spec: types.ServerSpecV2{
|
||||
|
@ -821,7 +821,7 @@ func (s *ServicesTestSuite) U2FCRUD(c *check.C) {
|
|||
c.Assert(®istration, check.DeepEquals, registrationOut)
|
||||
|
||||
// Attempt to upsert the same device name with a different ID.
|
||||
dev.Id = uuid.New()
|
||||
dev.Id = uuid.New().String()
|
||||
err = s.WebS.UpsertMFADevice(ctx, user1, dev)
|
||||
c.Assert(trace.IsAlreadyExists(err), check.Equals, true)
|
||||
|
||||
|
|
|
@ -27,12 +27,12 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/gravitational/teleport/api/types"
|
||||
"github.com/gravitational/teleport/lib/backend"
|
||||
"github.com/gravitational/teleport/lib/defaults"
|
||||
"github.com/jonboulle/clockwork"
|
||||
"github.com/moby/term"
|
||||
"github.com/pborman/uuid"
|
||||
|
||||
"github.com/gravitational/trace"
|
||||
)
|
||||
|
@ -58,8 +58,8 @@ func (s *ID) Check() error {
|
|||
|
||||
// ParseID parses ID and checks if it's correct.
|
||||
func ParseID(id string) (*ID, error) {
|
||||
val := uuid.Parse(id)
|
||||
if val == nil {
|
||||
_, err := uuid.Parse(id)
|
||||
if err != nil {
|
||||
return nil, trace.BadParameter("%v not a valid UUID", id)
|
||||
}
|
||||
uid := ID(id)
|
||||
|
@ -68,14 +68,14 @@ func ParseID(id string) (*ID, error) {
|
|||
|
||||
// NewID returns new session ID. The session ID is based on UUIDv4.
|
||||
func NewID() ID {
|
||||
return ID(uuid.New())
|
||||
return ID(uuid.New().String())
|
||||
}
|
||||
|
||||
// DELETE IN: 4.1.0.
|
||||
//
|
||||
// NewLegacyID creates a new session ID in the UUIDv1 legacy format.
|
||||
func NewLegacyID() ID {
|
||||
return ID(uuid.NewUUID().String())
|
||||
return ID(uuid.New().String())
|
||||
}
|
||||
|
||||
// Session is an interactive collaboration session that represents one
|
||||
|
|
|
@ -47,8 +47,8 @@ import (
|
|||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"github.com/google/go-cmp/cmp/cmpopts"
|
||||
"github.com/google/uuid"
|
||||
"github.com/jonboulle/clockwork"
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/stretchr/testify/require"
|
||||
"go.uber.org/atomic"
|
||||
)
|
||||
|
@ -118,7 +118,7 @@ func SetUpSuiteWithConfig(t *testing.T, config suiteConfig) *Suite {
|
|||
|
||||
s.clock = clockwork.NewFakeClock()
|
||||
s.dataDir = t.TempDir()
|
||||
s.hostUUID = uuid.New()
|
||||
s.hostUUID = uuid.New().String()
|
||||
|
||||
var err error
|
||||
// Create Auth Server.
|
||||
|
@ -163,7 +163,7 @@ func SetUpSuiteWithConfig(t *testing.T, config suiteConfig) *Suite {
|
|||
|
||||
// Create a in-memory HTTP server that will respond with a UUID. This value
|
||||
// will be checked in the client later to ensure a connection was made.
|
||||
s.message = uuid.New()
|
||||
s.message = uuid.New().String()
|
||||
|
||||
s.testhttp = httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprintln(w, s.message)
|
||||
|
|
|
@ -37,7 +37,7 @@ import (
|
|||
"github.com/gravitational/trace"
|
||||
"github.com/gravitational/ttlmap"
|
||||
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/google/uuid"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
|
@ -116,7 +116,7 @@ func (s *Server) newStreamWriter(identity *tlsca.Identity, app types.Application
|
|||
// Each chunk has its own ID. Create a new UUID for this chunk which will be
|
||||
// emitted in a new event to the audit log that can be use to aggregate all
|
||||
// chunks for a particular session.
|
||||
chunkID := uuid.New()
|
||||
chunkID := uuid.New().String()
|
||||
|
||||
// Create a sync or async streamer depending on configuration of cluster.
|
||||
streamer, err := s.newStreamer(s.closeContext, chunkID, recConfig)
|
||||
|
|
|
@ -45,10 +45,10 @@ import (
|
|||
"github.com/gravitational/teleport/lib/tlsca"
|
||||
"github.com/gravitational/teleport/lib/utils"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/gravitational/trace"
|
||||
"github.com/jackc/pgconn"
|
||||
"github.com/jonboulle/clockwork"
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/siddontang/go-mysql/client"
|
||||
mysqllib "github.com/siddontang/go-mysql/mysql"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
@ -850,7 +850,7 @@ func (c *testContext) Close() error {
|
|||
func setupTestContext(ctx context.Context, t *testing.T, withDatabases ...withDatabaseOption) *testContext {
|
||||
testCtx := &testContext{
|
||||
clusterName: "root.example.com",
|
||||
hostID: uuid.New(),
|
||||
hostID: uuid.New().String(),
|
||||
postgres: make(map[string]testPostgres),
|
||||
mysql: make(map[string]testMySQL),
|
||||
mongo: make(map[string]testMongoDB),
|
||||
|
|
|
@ -31,7 +31,7 @@ import (
|
|||
"github.com/aws/aws-sdk-go/service/rds"
|
||||
"github.com/aws/aws-sdk-go/service/rds/rdsiface"
|
||||
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/google/uuid"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
|
@ -144,7 +144,7 @@ func makeRDSInstance(t *testing.T, name, region string, labels map[string]string
|
|||
instance := &rds.DBInstance{
|
||||
DBInstanceArn: aws.String(fmt.Sprintf("arn:aws:rds:%v:1234567890:db:%v", region, name)),
|
||||
DBInstanceIdentifier: aws.String(name),
|
||||
DbiResourceId: aws.String(uuid.New()),
|
||||
DbiResourceId: aws.String(uuid.New().String()),
|
||||
Engine: aws.String(services.RDSEnginePostgres),
|
||||
Endpoint: &rds.Endpoint{
|
||||
Address: aws.String("localhost"),
|
||||
|
@ -161,7 +161,7 @@ func makeRDSCluster(t *testing.T, name, region, engineMode string, labels map[st
|
|||
cluster := &rds.DBCluster{
|
||||
DBClusterArn: aws.String(fmt.Sprintf("arn:aws:rds:%v:1234567890:cluster:%v", region, name)),
|
||||
DBClusterIdentifier: aws.String(name),
|
||||
DbClusterResourceId: aws.String(uuid.New()),
|
||||
DbClusterResourceId: aws.String(uuid.New().String()),
|
||||
Engine: aws.String(services.RDSEngineAuroraMySQL),
|
||||
EngineMode: aws.String(engineMode),
|
||||
Endpoint: aws.String("localhost"),
|
||||
|
|
|
@ -40,9 +40,9 @@ import (
|
|||
"github.com/gravitational/teleport/lib/srv/db/postgres"
|
||||
"github.com/gravitational/teleport/lib/utils"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/gravitational/trace"
|
||||
"github.com/jonboulle/clockwork"
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
|
@ -817,7 +817,7 @@ func (s *Server) authorize(ctx context.Context) (*common.Session, error) {
|
|||
}
|
||||
s.log.Debugf("Will connect to database %q at %v.", database.GetName(),
|
||||
database.GetURI())
|
||||
id := uuid.New()
|
||||
id := uuid.New().String()
|
||||
return &common.Session{
|
||||
ID: id,
|
||||
ClusterName: identity.RouteToCluster,
|
||||
|
|
|
@ -44,8 +44,8 @@ import (
|
|||
"github.com/gravitational/teleport/lib/utils"
|
||||
"github.com/gravitational/trace"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/jonboulle/clockwork"
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
|
@ -271,7 +271,7 @@ func New(c ServerConfig) (*Server, error) {
|
|||
"dst-addr": c.DstAddr.String(),
|
||||
},
|
||||
}),
|
||||
id: uuid.New(),
|
||||
id: uuid.New().String(),
|
||||
targetConn: c.TargetConn,
|
||||
serverConn: utils.NewTrackingConn(serverConn),
|
||||
clientConn: clientConn,
|
||||
|
|
|
@ -38,8 +38,8 @@ import (
|
|||
"github.com/gravitational/teleport/lib/sshutils"
|
||||
"github.com/gravitational/teleport/lib/utils"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/gravitational/trace"
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
@ -452,7 +452,8 @@ func (t *proxySubsys) proxyToHost(
|
|||
func (t *proxySubsys) getMatchingServer(servers []types.Server, strategy types.RoutingStrategy) (types.Server, error) {
|
||||
// check if hostname is a valid uuid or EC2 node ID. If it is, we will
|
||||
// preferentially match by node ID over node hostname.
|
||||
hostIsUniqueID := uuid.Parse(t.host) != nil || utils.IsEC2NodeID(t.host)
|
||||
_, err := uuid.Parse(t.host)
|
||||
hostIsUniqueID := err == nil || utils.IsEC2NodeID(t.host)
|
||||
|
||||
ips, _ := net.LookupHost(t.host)
|
||||
|
||||
|
|
|
@ -55,9 +55,9 @@ import (
|
|||
"github.com/gravitational/teleport/lib/sshutils"
|
||||
"github.com/gravitational/teleport/lib/utils"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/gravitational/trace"
|
||||
"github.com/jonboulle/clockwork"
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
@ -148,7 +148,7 @@ func newCustomFixture(t *testing.T, mutateCfg func(*auth.TestServerConfig), sshO
|
|||
signer, err := sshutils.NewSigner(priv, certs.SSH)
|
||||
require.NoError(t, err)
|
||||
|
||||
nodeID := uuid.New()
|
||||
nodeID := uuid.New().String()
|
||||
nodeClient, err := testServer.NewClient(auth.TestIdentity{
|
||||
I: auth.BuiltinRole{
|
||||
Role: types.RoleNode,
|
||||
|
@ -249,7 +249,7 @@ func newCustomFixture(t *testing.T, mutateCfg func(*auth.TestServerConfig), sshO
|
|||
|
||||
func newProxyClient(t *testing.T, testSvr *auth.TestServer) (*auth.Client, string) {
|
||||
// create proxy client used in some tests
|
||||
proxyID := uuid.New()
|
||||
proxyID := uuid.New().String()
|
||||
proxyClient, err := testSvr.NewClient(auth.TestIdentity{
|
||||
I: auth.BuiltinRole{
|
||||
Role: types.RoleProxy,
|
||||
|
@ -261,7 +261,7 @@ func newProxyClient(t *testing.T, testSvr *auth.TestServer) (*auth.Client, strin
|
|||
}
|
||||
|
||||
func newNodeClient(t *testing.T, testSvr *auth.TestServer) (*auth.Client, string) {
|
||||
nodeID := uuid.New()
|
||||
nodeID := uuid.New().String()
|
||||
nodeClient, err := testSvr.NewClient(auth.TestIdentity{
|
||||
I: auth.BuiltinRole{
|
||||
Role: types.RoleNode,
|
||||
|
|
|
@ -19,7 +19,7 @@ package utils
|
|||
import (
|
||||
"github.com/gravitational/teleport/lib/fixtures"
|
||||
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
// UID provides an interface for generating unique identifiers.
|
||||
|
@ -38,7 +38,7 @@ func NewRealUID() UID {
|
|||
|
||||
// New generates a new UUID4.
|
||||
func (u *realUID) New() string {
|
||||
return uuid.New()
|
||||
return uuid.New().String()
|
||||
}
|
||||
|
||||
// fakeUID is a fake UID generator used in tests.
|
||||
|
|
|
@ -37,8 +37,8 @@ import (
|
|||
apiutils "github.com/gravitational/teleport/api/utils"
|
||||
"github.com/gravitational/teleport/lib/modules"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/gravitational/trace"
|
||||
"github.com/pborman/uuid"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
|
@ -454,7 +454,7 @@ func ReadOrMakeHostUUID(dataDir string) (string, error) {
|
|||
if !trace.IsNotFound(err) {
|
||||
return "", trace.Wrap(err)
|
||||
}
|
||||
id = uuid.New()
|
||||
id = uuid.New().String()
|
||||
if err = WriteHostUUID(dataDir, id); err != nil {
|
||||
return "", trace.Wrap(err)
|
||||
}
|
||||
|
|
|
@ -83,9 +83,9 @@ import (
|
|||
"github.com/beevik/etree"
|
||||
"github.com/gogo/protobuf/proto"
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"github.com/google/uuid"
|
||||
"github.com/jonboulle/clockwork"
|
||||
lemma_secret "github.com/mailgun/lemma/secret"
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/pquerna/otp/totp"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
@ -2098,7 +2098,7 @@ func TestApplicationAccessDisabled(t *testing.T) {
|
|||
PublicAddr: "panel.example.com",
|
||||
})
|
||||
require.NoError(t, err)
|
||||
server, err := types.NewAppServerV3FromApp(app, "host", uuid.New())
|
||||
server, err := types.NewAppServerV3FromApp(app, "host", uuid.New().String())
|
||||
require.NoError(t, err)
|
||||
_, err = env.server.Auth().UpsertApplicationServer(context.Background(), server)
|
||||
require.NoError(t, err)
|
||||
|
@ -2497,7 +2497,7 @@ func (s *WebSuite) TestCreateAppSession(c *C) {
|
|||
PublicAddr: "panel.example.com",
|
||||
})
|
||||
c.Assert(err, IsNil)
|
||||
server, err := types.NewAppServerV3FromApp(app, "host", uuid.New())
|
||||
server, err := types.NewAppServerV3FromApp(app, "host", uuid.New().String())
|
||||
c.Assert(err, IsNil)
|
||||
_, err = s.server.Auth().UpsertApplicationServer(context.Background(), server)
|
||||
c.Assert(err, IsNil)
|
||||
|
|
|
@ -35,7 +35,7 @@ import (
|
|||
"github.com/gravitational/teleport/lib/services"
|
||||
"github.com/gravitational/teleport/lib/services/local"
|
||||
|
||||
"github.com/pborman/uuid"
|
||||
"github.com/google/uuid"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
|
@ -120,7 +120,7 @@ func insertServers(ctx context.Context, t assert.TestingT, svc services.Presence
|
|||
labels[fmt.Sprintf("label-key-%d", i)] = fmt.Sprintf("label-val-%d", i)
|
||||
}
|
||||
for i := 0; i < count; i++ {
|
||||
name := uuid.New()
|
||||
name := uuid.New().String()
|
||||
addr := fmt.Sprintf("%s.%s", name, clusterName)
|
||||
server := &types.ServerV2{
|
||||
Kind: kind,
|
||||
|
|
|
@ -21,9 +21,9 @@ import (
|
|||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/gravitational/kingpin"
|
||||
"github.com/gravitational/trace"
|
||||
"github.com/pborman/uuid"
|
||||
|
||||
"github.com/gravitational/teleport/api/types"
|
||||
"github.com/gravitational/teleport/lib/auth"
|
||||
|
@ -74,7 +74,7 @@ func (c *LockCommand) CreateLock(ctx context.Context, client auth.ClientI) error
|
|||
return trace.Wrap(err)
|
||||
}
|
||||
c.spec.Expires = lockExpiry
|
||||
lock, err := types.NewLock(uuid.New(), c.spec)
|
||||
lock, err := types.NewLock(uuid.New().String(), c.spec)
|
||||
if err != nil {
|
||||
return trace.Wrap(err)
|
||||
}
|
||||
|
|
|
@ -32,8 +32,8 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws/credentials"
|
||||
"github.com/google/uuid"
|
||||
"github.com/gravitational/trace"
|
||||
"github.com/pborman/uuid"
|
||||
|
||||
"github.com/gravitational/teleport/lib/asciitable"
|
||||
"github.com/gravitational/teleport/lib/client"
|
||||
|
@ -120,8 +120,8 @@ func onAWS(cf *CLIConf) error {
|
|||
// genAndSetAWSCredentials generates and returns fake AWS credential that are used
|
||||
// for signing an AWS request during aws CLI call and verified on local AWS proxy side.
|
||||
func genAndSetAWSCredentials() (*credentials.Credentials, error) {
|
||||
id := uuid.NewUUID().String()
|
||||
secret := uuid.NewUUID().String()
|
||||
id := uuid.New().String()
|
||||
secret := uuid.New().String()
|
||||
if err := setFakeAWSEnvCredentials(id, secret); err != nil {
|
||||
return nil, trace.Wrap(err)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue