Skip to content

Commit

Permalink
Skeleton CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
duaraghav8 committed Oct 11, 2019
1 parent b022103 commit e1f7192
Show file tree
Hide file tree
Showing 329 changed files with 170,205 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea/
bin/
15 changes: 15 additions & 0 deletions command/assign-applications.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package command

type AssignApplicationsCommand struct {}

func (c *AssignApplicationsCommand) Help() string {
return ""
}

func (c *AssignApplicationsCommand) Run(args []string) int {
return 0
}

func (c *AssignApplicationsCommand) Synopsis() string {
return "Assign applications to an organization member"
}
15 changes: 15 additions & 0 deletions command/create-user.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package command

type CreateUserCommand struct {}

func (c *CreateUserCommand) Help() string {
return ""
}

func (c *CreateUserCommand) Run(args []string) int {
return 0
}

func (c *CreateUserCommand) Synopsis() string {
return "Create a new user in the organization"
}
15 changes: 15 additions & 0 deletions command/deactivate-user.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package command

type DeactivateUserCommand struct {}

func (c *DeactivateUserCommand) Help() string {
return ""
}

func (c *DeactivateUserCommand) Run(args []string) int {
return 0
}

func (c *DeactivateUserCommand) Synopsis() string {
return "Deactivate an organization member"
}
15 changes: 15 additions & 0 deletions command/list-user-accesses.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package command

type ListUserAccessesCommand struct {}

func (c *ListUserAccessesCommand) Help() string {
return ""
}

func (c *ListUserAccessesCommand) Run(args []string) int {
return 0
}

func (c *ListUserAccessesCommand) Synopsis() string {
return "List applications assigned to an organization member"
}
15 changes: 15 additions & 0 deletions command/reset-user-multifactor.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package command

type ResetUserMultifactorCommand struct {}

func (c *ResetUserMultifactorCommand) Help() string {
return ""
}

func (c *ResetUserMultifactorCommand) Run(args []string) int {
return 0
}

func (c *ResetUserMultifactorCommand) Synopsis() string {
return "Reset organization member's Multifactor"
}
15 changes: 15 additions & 0 deletions command/reset-user-password.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package command

type ResetUserPasswordCommand struct {}

func (c *ResetUserPasswordCommand) Help() string {
return ""
}

func (c *ResetUserPasswordCommand) Run(args []string) int {
return 0
}

func (c *ResetUserPasswordCommand) Synopsis() string {
return "Reset organization member's password"
}
5 changes: 5 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module github.com/duaraghav8/okta-admin

go 1.13

require github.com/mitchellh/cli v1.0.0
20 changes: 20 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310 h1:BUAU3CGlLvorLI26FmByPp2eC2qla6E1Tw+scpcg/to=
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY=
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o=
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-isatty v0.0.3 h1:ns/ykhmWi7G9O+8a448SecJU3nSMBXJfqQkl0upE1jI=
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mitchellh/cli v1.0.0 h1:iGBIsUe3+HZ/AD/Vd7DErOt5sU9fa8Uj7A2s1aggv1Y=
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
github.com/posener/complete v1.1.1 h1:ccV59UEOTzVDnDUEFdT95ZzHVZ+5+158q8+SJb2QV5w=
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc h1:MeuS1UDyZyFH++6vVy44PuufTeFF0d0nfI6XB87YGSk=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
44 changes: 44 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package main

import (
"fmt"
"os"

cmd "github.com/duaraghav8/okta-admin/command"
"github.com/mitchellh/cli"
)

func main() {
c := cli.CLI{
Name: "okta-admin",
Version: "1.0.0",
Commands: map[string]cli.CommandFactory{
"create-user": func() (command cli.Command, err error) {
return &cmd.CreateUserCommand{}, nil
},
"reset-user-password": func() (command cli.Command, err error) {
return &cmd.ResetUserPasswordCommand{}, nil
},
"deactivate-user": func() (command cli.Command, err error) {
return &cmd.DeactivateUserCommand{}, nil
},
"list-user-accesses": func() (command cli.Command, err error) {
return &cmd.ListUserAccessesCommand{}, nil
},
"assign-applications": func() (command cli.Command, err error) {
return &cmd.AssignApplicationsCommand{}, nil
},
"reset-user-multifactor": func() (command cli.Command, err error) {
return &cmd.ResetUserMultifactorCommand{}, nil
},
},
Args: os.Args[1:],
}

exitStatus, err := c.Run()
if err != nil {
fmt.Println(err)
}

os.Exit(exitStatus)
}
22 changes: 22 additions & 0 deletions vendor/github.com/armon/go-radix/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions vendor/github.com/armon/go-radix/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions vendor/github.com/armon/go-radix/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions vendor/github.com/armon/go-radix/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e1f7192

Please sign in to comment.