diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ddcb57a..1c2ef4d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [v1.7.1](https://github.com/micromdm/micromdm/compare/v1.6.0...v1.7.1) April, 2020 + +* Replace un-maintained UUID dependency #665 + ## [v1.7.0](https://github.com/micromdm/micromdm/compare/v1.6.0...v1.7.0-alpha) March, 2020 ### Reliability, scalability, security, and usability improvements: diff --git a/cmd/mdmctl/apply.go b/cmd/mdmctl/apply.go index cd19a204..c881e4d2 100644 --- a/cmd/mdmctl/apply.go +++ b/cmd/mdmctl/apply.go @@ -16,8 +16,8 @@ import ( "strings" "github.com/go-kit/kit/log" + "github.com/google/uuid" "github.com/pkg/errors" - uuid "github.com/satori/go.uuid" "golang.org/x/crypto/pkcs12" "github.com/micromdm/micromdm/pkg/crypto/profileutil" @@ -119,7 +119,7 @@ func (cmd *applyCommand) applyBlueprint(args []string) error { if *flTemplate { newBlueprint := &blueprint.Blueprint{ Name: "exampleName", - UUID: uuid.NewV4().String(), + UUID: uuid.New().String(), ApplicationURLs: []string{cmd.config.ServerURL + "repo/exampleAppManifest.plist"}, ProfileIdentifiers: []string{"com.example.my.profile"}, UserUUID: []string{"your-admin-account-uuid"}, diff --git a/go.mod b/go.mod index b87af0b8..2b12352b 100644 --- a/go.mod +++ b/go.mod @@ -11,13 +11,13 @@ require ( github.com/go-stack/stack v1.7.0 // indirect github.com/gogo/protobuf v1.3.1 github.com/golang/protobuf v1.3.2 + github.com/google/uuid v1.1.1 github.com/gorilla/context v1.1.1 // indirect github.com/gorilla/mux v1.6.2 github.com/groob/finalizer v0.0.0-20170707115354-4c2ed49aabda github.com/groob/plist v0.0.0-20180203051248-dd56909aee38 github.com/jmoiron/sqlx v0.0.0-20180614180643-0dae4fefe7c0 github.com/kolide/kit v0.0.0-20180912215818-0c28f72eb2b0 - github.com/kr/pretty v0.1.0 // indirect github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect github.com/lib/pq v1.0.0 @@ -27,16 +27,13 @@ require ( github.com/pkg/errors v0.8.0 github.com/pmezard/go-difflib v1.0.0 // indirect github.com/pressly/goose v2.3.0+incompatible - github.com/satori/go.uuid v1.2.0 github.com/stretchr/testify v1.2.2 // indirect github.com/ziutek/mymysql v1.5.4 // indirect golang.org/x/crypto v0.0.0-20180614174826-fd5f17ee7299 golang.org/x/net v0.0.0-20180724234803-3673e40ba225 - golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f // indirect golang.org/x/sys v0.0.0-20180614134839-8883426083c0 // indirect google.golang.org/appengine v1.2.0 // indirect gopkg.in/Masterminds/squirrel.v1 v1.0.0-20170825200431-a6b93000bd21 - gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect ) replace github.com/fullsailor/pkcs7 => github.com/groob/pkcs7 v0.0.0-20180824154052-36585635cb64 diff --git a/go.sum b/go.sum index 2f6699a8..44d44d9f 100644 --- a/go.sum +++ b/go.sum @@ -16,14 +16,14 @@ github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG github.com/go-stack/stack v1.6.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-stack/stack v1.7.0 h1:S04+lLfST9FvL8dl4R31wVUC/paZp/WQZbLmUgWboGw= github.com/go-stack/stack v1.7.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gogo/protobuf v1.0.0 h1:2jyBKDKU/8v3v2xVR2PtiWQviFUyiaGk2rpfyFT8rTM= -github.com/gogo/protobuf v1.0.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/context v0.0.0-20160226214623-1ea25387ff6f/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/context v1.1.1 h1:AWwleXJkX/nhcU9bZSnZoi3h/qGYqQAGhq6zZe/aQW8= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= @@ -44,11 +44,6 @@ github.com/kolide/kit v0.0.0-20180912215818-0c28f72eb2b0 h1:8UB0NJBoB/lN2O9zG9+U github.com/kolide/kit v0.0.0-20180912215818-0c28f72eb2b0/go.mod h1:N3Yv8okDVC/5qZhPA9uxVYRfkp4mD2vrlQiSCWlNCpg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -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/lann/builder v0.0.0-20180802200727-47ae307949d0 h1:SOEGU9fKiNWd/HOJuq6+3iTQz8KNCLtVX6idSoTLdUw= github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 h1:P6pPBnrTSX3DEVR4fDembhRWSsG5rVo6hYhAB/ADZrk= @@ -67,8 +62,6 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pressly/goose v2.3.0+incompatible h1:Nc9o+JsN4j8sS4hvRzcfKYOrr7W2EXMDY2wNYtKmaVc= github.com/pressly/goose v2.3.0+incompatible/go.mod h1:m+QHWCqxR3k8D9l7qfzuC/djtlfzxr34mozWDYEu1z8= -github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/ziutek/mymysql v1.5.4 h1:GB0qdRGsTwQSBVYuVShFBKaXSnSnYYC2d9knnE1LHFs= @@ -78,8 +71,6 @@ golang.org/x/crypto v0.0.0-20180614174826-fd5f17ee7299/go.mod h1:6SG95UA2DQfeDnf golang.org/x/net v0.0.0-20170726083632-f5079bd7f6f7/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225 h1:kNX+jCowfMYzvlSvJu5pQWEmyWFrBXJ3PBy10xKMXK8= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170728174421-0f826bdd13b5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180614134839-8883426083c0 h1:5mOaSPjCt3RW5w1KpSFOVg8VdqQQ/FjfM5/m50f/8wM= golang.org/x/sys v0.0.0-20180614134839-8883426083c0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -90,5 +81,3 @@ google.golang.org/appengine v1.2.0 h1:S0iUepdCWODXRvtE+gcRDd15L+k+k1AiHlMiMjefH2 google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= gopkg.in/Masterminds/squirrel.v1 v1.0.0-20170825200431-a6b93000bd21 h1:GmGVIcDxdecAcVjcTp4IpK4VmCMxXhyZKwN2eIzsZ4Y= gopkg.in/Masterminds/squirrel.v1 v1.0.0-20170825200431-a6b93000bd21/go.mod h1:8PH4rQjb7OdPC6OWDDuY6J/PT8iSNTiff3jmccc2m10= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/mdm/acknowledge.go b/mdm/acknowledge.go index 0417590e..c0c10d15 100644 --- a/mdm/acknowledge.go +++ b/mdm/acknowledge.go @@ -6,8 +6,8 @@ import ( "time" "github.com/go-kit/kit/endpoint" + "github.com/google/uuid" "github.com/pkg/errors" - uuid "github.com/satori/go.uuid" ) func (svc *MDMService) Acknowledge(ctx context.Context, req AcknowledgeEvent) (payload []byte, err error) { @@ -51,7 +51,7 @@ func decodeAcknowledgeRequest(ctx context.Context, r *http.Request) (interface{} } event := AcknowledgeEvent{ - ID: uuid.NewV4().String(), + ID: uuid.New().String(), Time: time.Now().UTC(), Response: res, Params: params, diff --git a/mdm/checkin.go b/mdm/checkin.go index 67a30d98..0b996957 100644 --- a/mdm/checkin.go +++ b/mdm/checkin.go @@ -6,8 +6,8 @@ import ( "time" "github.com/go-kit/kit/endpoint" + "github.com/google/uuid" "github.com/pkg/errors" - uuid "github.com/satori/go.uuid" ) func (svc *MDMService) Checkin(ctx context.Context, event CheckinEvent) error { @@ -87,7 +87,7 @@ func decodeCheckinRequest(ctx context.Context, r *http.Request) (interface{}, er } event := CheckinEvent{ - ID: uuid.NewV4().String(), + ID: uuid.New().String(), Time: time.Now().UTC(), Command: cmd, Params: params, diff --git a/mdm/enroll/profile.go b/mdm/enroll/profile.go index f6d39bf6..09632f05 100644 --- a/mdm/enroll/profile.go +++ b/mdm/enroll/profile.go @@ -3,7 +3,7 @@ package enroll import ( "time" - "github.com/satori/go.uuid" + "github.com/google/uuid" ) type Payload struct { @@ -36,7 +36,7 @@ type Profile struct { } func NewProfile() *Profile { - payloadUuid := uuid.NewV4() + payloadUuid := uuid.New() return &Profile{ PayloadVersion: 1, @@ -46,7 +46,7 @@ func NewProfile() *Profile { } func NewPayload(payloadType string) *Payload { - payloadUuid := uuid.NewV4() + payloadUuid := uuid.New() return &Payload{ PayloadVersion: 1, diff --git a/mdm/mdm/command.go b/mdm/mdm/command.go index 1e450516..ab3d6a41 100644 --- a/mdm/mdm/command.go +++ b/mdm/mdm/command.go @@ -1,8 +1,8 @@ package mdm import ( + "github.com/google/uuid" "github.com/micromdm/micromdm/mdm/appmanifest" - uuid "github.com/satori/go.uuid" ) type CommandRequest struct { @@ -17,7 +17,7 @@ type CommandPayload struct { func NewCommandPayload(request *CommandRequest) (*CommandPayload, error) { payload := &CommandPayload{ - CommandUUID: uuid.NewV4().String(), + CommandUUID: uuid.New().String(), Command: request.Command, } return payload, nil diff --git a/platform/command/event.go b/platform/command/event.go index fdae4ba4..9c7ace35 100644 --- a/platform/command/event.go +++ b/platform/command/event.go @@ -4,10 +4,11 @@ import ( "time" "github.com/gogo/protobuf/proto" + "github.com/google/uuid" + "github.com/pkg/errors" + "github.com/micromdm/micromdm/mdm/mdm" "github.com/micromdm/micromdm/platform/command/internal/commandproto" - "github.com/pkg/errors" - uuid "github.com/satori/go.uuid" ) type Event struct { @@ -20,7 +21,7 @@ type Event struct { // NewEvent returns an Event with a unique ID and the current time. func NewEvent(payload *mdm.CommandPayload, udid string) *Event { event := Event{ - ID: uuid.NewV4().String(), + ID: uuid.New().String(), Time: time.Now().UTC(), Payload: payload, DeviceUDID: udid, diff --git a/platform/dep/sync/event.go b/platform/dep/sync/event.go index 61a6b8fc..ae52526b 100644 --- a/platform/dep/sync/event.go +++ b/platform/dep/sync/event.go @@ -4,7 +4,7 @@ import ( "time" "github.com/gogo/protobuf/proto" - uuid "github.com/satori/go.uuid" + "github.com/google/uuid" "github.com/micromdm/micromdm/dep" "github.com/micromdm/micromdm/platform/dep/sync/internal/depsyncproto" @@ -18,7 +18,7 @@ type Event struct { func NewEvent(devices []dep.Device) *Event { event := Event{ - ID: uuid.NewV4().String(), + ID: uuid.New().String(), Time: time.Now().UTC(), Devices: devices, } diff --git a/platform/device/worker.go b/platform/device/worker.go index 48e92e91..230664b0 100644 --- a/platform/device/worker.go +++ b/platform/device/worker.go @@ -6,8 +6,8 @@ import ( "github.com/go-kit/kit/log" "github.com/go-kit/kit/log/level" + "github.com/google/uuid" "github.com/pkg/errors" - uuid "github.com/satori/go.uuid" "github.com/micromdm/micromdm/mdm" "github.com/micromdm/micromdm/platform/dep/sync" @@ -113,7 +113,7 @@ func (w *Worker) updateFromDEPSync(ctx context.Context, message []byte) error { } if dev.UUID == "" { - dev.UUID = uuid.NewV4().String() + dev.UUID = uuid.New().String() } dev.SerialNumber = dd.SerialNumber @@ -243,7 +243,7 @@ func (w *Worker) updateFromAuthenticate(ctx context.Context, message []byte) err } if device.UUID == "" { - device.UUID = uuid.NewV4().String() + device.UUID = uuid.New().String() } device.UDID = ev.Command.UDID device.OSVersion = ev.Command.OSVersion diff --git a/platform/user/user.go b/platform/user/user.go index cfa7f8e4..8063847e 100644 --- a/platform/user/user.go +++ b/platform/user/user.go @@ -3,8 +3,8 @@ package user import ( "github.com/gogo/protobuf/proto" + "github.com/google/uuid" "github.com/pkg/errors" - uuid "github.com/satori/go.uuid" "github.com/micromdm/micromdm/platform/user/internal/userproto" ) @@ -22,7 +22,7 @@ type User struct { func NewFromRequest(u User) (*User, error) { newUser := User{ - UUID: uuid.NewV4().String(), + UUID: uuid.New().String(), UserShortname: u.UserShortname, UserLongname: u.UserLongname, PasswordHash: u.PasswordHash, diff --git a/platform/user/worker.go b/platform/user/worker.go index 3bbc212d..a49b1879 100644 --- a/platform/user/worker.go +++ b/platform/user/worker.go @@ -5,8 +5,8 @@ import ( "github.com/go-kit/kit/log" "github.com/go-kit/kit/log/level" + "github.com/google/uuid" "github.com/pkg/errors" - uuid "github.com/satori/go.uuid" "github.com/micromdm/micromdm/mdm" "github.com/micromdm/micromdm/platform/pubsub" @@ -82,7 +82,7 @@ func (w *Worker) updateUserFromTokenUpdate(ctx context.Context, message []byte) ev.Command.UserID, ) } - usr.UUID = uuid.NewV4().String() + usr.UUID = uuid.New().String() } usr.UDID = ev.Command.UDID diff --git a/vpp/clientconfigsrv.go b/vpp/clientconfigsrv.go index 12aae2f0..eef7f921 100644 --- a/vpp/clientconfigsrv.go +++ b/vpp/clientconfigsrv.go @@ -2,9 +2,10 @@ package vpp import ( "encoding/json" - "github.com/pkg/errors" - "github.com/satori/go.uuid" "strings" + + "github.com/google/uuid" + "github.com/pkg/errors" ) // Contains information that associates your particular mdm server to a VPP account token @@ -119,7 +120,7 @@ func (c *Client) GetClientContext() (*ClientContext, error) { // Sets the values that determine which mdm server is associated with a VPP account token func (c *Client) SetClientContext(serverURL string) (*ClientContext, error) { // Generate a UUID that is tracked to ensure VPP licenses are up to date - uuid := uuid.NewV4().String() + uuid := uuid.New().String() // Generate a ClientContext string with the new UUID and the current serverURL context := ClientContext{serverURL, uuid}