Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RootCmd = &cobra.Command{ Use: "rai-keygen", Short: "Generates profiles to be used with the rai client", Long: "Generates a profile file that needs to be placed in `~/.rai_profile` (linux/OSX) or " + "`%USERPROFILE%/.rai_profile` (Windows -- for me this is `C:\\Users\\abduld\\.rai_profile`). " + "The rai client reads these configuration files to authenticate the user. " + "A seed (specified by `secret`) is used to generate secure credentials", SilenceUsage: true, SilenceErrors: true, PreRunE: func(cmd *cobra.Command, args []string) error { if username == "" { return errors.New("empty username") } if email == "" { return errors.New("empty email") } if roleString == "" { return errors.New("empty role") } role = acl.Role(roleString) if !role.Validate() { return errors.Errorf("The role %s is not valid. Valid roles are %v", role, acl.Roles) } return nil }, RunE: func(cmd *cobra.Command, args []string) error { prof, err := provider.New( auth.Username(username), auth.Email(email), auth.Firstname(firstname), auth.Lastname(lastname), auth.TeamName(teamname), auth.Role(role), ) if err != nil { return err } if err := prof.Create(); err != nil { return err } fmt.Print(prof.Info().String()) return nil }, }
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.