mirror of
https://github.com/drone/drone-cli.git
synced 2024-11-23 01:11:57 +01:00
print machine account token
This commit is contained in:
parent
00907ac6ef
commit
513b079977
4
Gopkg.lock
generated
4
Gopkg.lock
generated
@ -68,7 +68,6 @@
|
||||
version = "v0.3.3"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/drone/drone-go"
|
||||
packages = [
|
||||
"drone",
|
||||
@ -79,7 +78,8 @@
|
||||
"plugin/registry",
|
||||
"plugin/secret"
|
||||
]
|
||||
revision = "1354e27647f2efee29b63dcd9cc561fafb4c51c1"
|
||||
revision = "b1b8a8f8f28e6beecb78e7c6fa95a26ccc040b26"
|
||||
version = "v1.0.1"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
|
@ -23,6 +23,10 @@ var userAddCmd = cli.Command{
|
||||
Name: "machine",
|
||||
Usage: "machine account",
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "token",
|
||||
Usage: "api token",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@ -38,11 +42,15 @@ func userAdd(c *cli.Context) error {
|
||||
Login: login,
|
||||
Admin: c.Bool("admin"),
|
||||
Machine: c.Bool("machine"),
|
||||
Token: c.String("token"),
|
||||
}
|
||||
user, err := client.UserCreate(in)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Printf("Successfully added user %s\n", user.Login)
|
||||
if user.Token != "" {
|
||||
fmt.Printf("Generated account token %s\n", user.Token)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
6
vendor/github.com/drone/drone-go/NOTICE
generated
vendored
Normal file
6
vendor/github.com/drone/drone-go/NOTICE
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
Drone
|
||||
Copyright 2019 Drone.IO, Inc
|
||||
|
||||
This product includes software developed at Drone.IO, Inc.
|
||||
(http://drone.io/).
|
||||
|
8
vendor/github.com/drone/drone-go/drone/types.go
generated
vendored
8
vendor/github.com/drone/drone-go/drone/types.go
generated
vendored
@ -29,13 +29,15 @@ type (
|
||||
Created int64 `json:"created"`
|
||||
Updated int64 `json:"updated"`
|
||||
LastLogin int64 `json:"last_login"`
|
||||
Token string `json:"token"`
|
||||
}
|
||||
|
||||
// UserPatch defines a user patch request.
|
||||
UserPatch struct {
|
||||
Active *bool `json:"active,omitempty"`
|
||||
Admin *bool `json:"admin,omitempty"`
|
||||
Machine *bool `json:"machine,omitempty"`
|
||||
Active *bool `json:"active,omitempty"`
|
||||
Admin *bool `json:"admin,omitempty"`
|
||||
Machine *bool `json:"machine,omitempty"`
|
||||
Token *string `json:"token,omitempty"`
|
||||
}
|
||||
|
||||
// Repo represents a repository.
|
||||
|
Loading…
Reference in New Issue
Block a user