Documentation ¶
Index ¶
- func AmIManager(token *types.TokenAuthentication) bool
- func AmIPlainUser(token *types.TokenAuthentication) bool
- func AmIReadonly(token *types.TokenAuthentication) bool
- func AuthTokenPath() (string, error)
- func CsvCreateGroupsCmd() *cobra.Command
- func CsvCreateUsersCmd() *cobra.Command
- func CsvDeleteGroupsCmd() *cobra.Command
- func CsvDeleteUsersCmd() *cobra.Command
- func DeleteCredentials() error
- func DeleteGroupCmd() *cobra.Command
- func DeleteUserCmd() *cobra.Command
- func Execute()
- func GetCredentials(url string) (*types.TokenAuthentication, error)
- func GetGroupInfo(cmd *cobra.Command) error
- func GetUserInfo(cmd *cobra.Command) error
- func JPEGToBase64(path string) (*string, error)
- func ListGroupCmd() *cobra.Command
- func ListUserCmd() *cobra.Command
- func LoginCmd() *cobra.Command
- func LogoutCmd() *cobra.Command
- func NeedsRefresh(token *types.TokenAuthentication) bool
- func NewGroupCmd() *cobra.Command
- func NewUserCmd() *cobra.Command
- func RestClient(token string) *resty.Client
- func UpdateGroupCmd() *cobra.Command
- func UpdateUserCmd() *cobra.Command
- func UserPasswdCmd() *cobra.Command
- func WhichIsMyTokenUID(token *types.TokenAuthentication) (uint, error)
- type JSONErrorOutput
- type JSONSuccessOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AmIManager ¶
func AmIManager(token *types.TokenAuthentication) bool
AmIManager parses access token and checks if admin property is set to true
func AmIPlainUser ¶
func AmIPlainUser(token *types.TokenAuthentication) bool
AmIPlainUser parses access token and checks if manager and/or readonly properties are set to true A plain user has both manager and readonly properties set to false
func AmIReadonly ¶
func AmIReadonly(token *types.TokenAuthentication) bool
AmIReadonly parses access token and checks if readonly property is set to true
func AuthTokenPath ¶
AuthTokenPath gets the path where Glim's JWT access token is stored Returns a string containing the file path inside user's home directory
func CsvCreateGroupsCmd ¶
func CsvCreateUsersCmd ¶
func CsvDeleteGroupsCmd ¶
func CsvDeleteUsersCmd ¶
func DeleteCredentials ¶
func DeleteCredentials() error
func DeleteGroupCmd ¶
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func GetCredentials ¶
func GetCredentials(url string) (*types.TokenAuthentication, error)
GetCredentials parses file with token and get new tokens if refresh is needed
func GetGroupInfo ¶
func GetUserInfo ¶
func JPEGToBase64 ¶
func NeedsRefresh ¶
func NeedsRefresh(token *types.TokenAuthentication) bool
NeedsRefresh check if token needs to be refreshed
func NewGroupCmd ¶
func RestClient ¶
func RestClient(token string) *resty.Client
func UpdateGroupCmd ¶
func UpdateUserCmd ¶
func WhichIsMyTokenUID ¶
func WhichIsMyTokenUID(token *types.TokenAuthentication) (uint, error)
WhichIsMyTokenUID parses access token and gets uid claim/property
Types ¶
type JSONErrorOutput ¶
type JSONErrorOutput struct {
ErrorMessage string `json:"error"`
}
type JSONSuccessOutput ¶
type JSONSuccessOutput struct {
Message string `json:"message"`
}
Source Files ¶
- credentials.go
- csv.go
- csv_create_groups.go
- csv_create_users.go
- csv_delete_groups.go
- csv_delete_users.go
- csv_groups.go
- csv_users.go
- group.go
- group_create.go
- group_delete.go
- group_read.go
- group_update.go
- login.go
- logout.go
- root.go
- selfsigned.go
- server.go
- server_start.go
- server_stop.go
- user.go
- user_create.go
- user_delete.go
- user_passwd.go
- user_read.go
- user_update.go
- utils.go