From 2f5aa0ae26e55789d1c4b6eb0ca9a054d14c88d1 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Wed, 17 Oct 2018 11:25:54 -0700 Subject: [PATCH] update secret endpoint --- Gopkg.lock | 2 +- drone/plugins/secret/get.go | 5 ++-- .../github.com/drone/drone-go/drone/types.go | 26 ++----------------- .../drone/drone-go/plugin/secret/secret.go | 1 + 4 files changed, 7 insertions(+), 27 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index ad254d0..9f04b93 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -84,7 +84,7 @@ "plugin/logger", "plugin/secret" ] - revision = "70af34cccf3c52890f3e4490e06f0bba2e2969c7" + revision = "d00b5c24549e5676acefedc4d5ef115471bf48eb" [[projects]] branch = "master" diff --git a/drone/plugins/secret/get.go b/drone/plugins/secret/get.go index fee1544..7d00647 100644 --- a/drone/plugins/secret/get.go +++ b/drone/plugins/secret/get.go @@ -68,6 +68,7 @@ var secretFindCmd = cli.Command{ func secretFind(c *cli.Context) error { path := c.Args().First() + key := c.Args().Get(1) slug := c.String("repo") owner, name, err := internal.ParseRepo(slug) @@ -91,7 +92,8 @@ func secretFind(c *cli.Context) error { } req := &secret.Request{ - Name: path, + Path: path, + Name: key, Repo: repo, Build: build, } @@ -105,7 +107,6 @@ func secretFind(c *cli.Context) error { if err != nil { return err } - println(req.Name) println(res.Data) return nil } diff --git a/vendor/github.com/drone/drone-go/drone/types.go b/vendor/github.com/drone/drone-go/drone/types.go index e78de76..79fb65c 100644 --- a/vendor/github.com/drone/drone-go/drone/types.go +++ b/vendor/github.com/drone/drone-go/drone/types.go @@ -148,8 +148,8 @@ type ( Version int64 `json:"version"` } - // DEPRECATED // Registry represents a docker registry with credentials. + // DEPRECATED Registry struct { Address string `json:"address"` Username string `json:"username"` @@ -161,34 +161,12 @@ type ( // Secret represents a secret variable, such as a password or token. Secret struct { + Name string `json:"name,omitempty"` Data string `json:"data,omitempty"` Pull bool `json:"pull,omitempty"` Fork bool `json:"fork,omitempty"` } - // // Activity represents an item in the user's feed or timeline. - // Activity struct { - // Owner string `json:"owner"` - // Name string `json:"name"` - // FullName string `json:"full_name"` - // Number int `json:"number,omitempty"` - // Event string `json:"event,omitempty"` - // Status string `json:"status,omitempty"` - // Created int64 `json:"created_at,omitempty"` - // Started int64 `json:"started_at,omitempty"` - // Finished int64 `json:"finished_at,omitempty"` - // Commit string `json:"commit,omitempty"` - // Branch string `json:"branch,omitempty"` - // Ref string `json:"ref,omitempty"` - // Refspec string `json:"refspec,omitempty"` - // Remote string `json:"remote,omitempty"` - // Title string `json:"title,omitempty"` - // Message string `json:"message,omitempty"` - // Author string `json:"author,omitempty"` - // Avatar string `json:"author_avatar,omitempty"` - // Email string `json:"author_email,omitempty"` - // } - // Server represents a server node. Server struct { ID string `json:"id"` diff --git a/vendor/github.com/drone/drone-go/plugin/secret/secret.go b/vendor/github.com/drone/drone-go/plugin/secret/secret.go index e80288f..1b75a57 100644 --- a/vendor/github.com/drone/drone-go/plugin/secret/secret.go +++ b/vendor/github.com/drone/drone-go/plugin/secret/secret.go @@ -26,6 +26,7 @@ const V1 = "application/vnd.drone.secret.v1+json" type ( // Request defines a secret request. Request struct { + Path string `json:"path"` Name string `json:"name"` Repo drone.Repo `json:"repo,omitempty"` Build drone.Build `json:"build,omitempty"`