keyrock

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ApplicationsCmd = ngsicli.Command{
	Name:     "applications",
	Usage:    "manage applications for Keyrock",
	Category: "Keyrock",
	Flags: []ngsicli.Flag{
		ngsicli.HostRFlag,
		ngsicli.OAuthTokenFlag,
	},
	Subcommands: []*ngsicli.Command{
		{
			Name:       "list",
			Usage:      "list applications",
			ServerList: []string{"keyrock"},
			Flags: []ngsicli.Flag{
				ngsicli.VerboseFlag,
				ngsicli.PrettyFlag,
			},
			Action: func(c *ngsicli.Context, ngsi *ngsilib.NGSI, client *ngsilib.Client) error {
				return applicationsList(c, ngsi, client)
			},
		},
		{
			Name:       "get",
			Usage:      "get application",
			ServerList: []string{"keyrock"},
			Flags: []ngsicli.Flag{
				keyrockApplicationIDRFlag,
				ngsicli.PrettyFlag,
			},
			RequiredFlags: []string{"aid"},
			Action: func(c *ngsicli.Context, ngsi *ngsilib.NGSI, client *ngsilib.Client) error {
				return applicationsGet(c, ngsi, client)
			},
		},
		{
			Name:       "create",
			Usage:      "create application",
			ServerList: []string{"keyrock"},
			Flags: []ngsicli.Flag{
				keyrcokApplicationDataFlag,
				keyrcokApplicationNameFlag,
				keyrcokApplicationDescriptionFlag,
				keyrcokApplicationURLFlag,
				keyrcokApplicationRedirectURIFlag,
				keyrcokApplicationRedirectSignOutURIFlag,
				keyrcokApplicationGrantTypeFlag,
				keyrcokApplicationTokenTypesFlag,
				keyrcokApplicationResponseTypeFlag,
				keyrcokApplicationClientTypeFlag,
				keyrcokApplicationScopeFlag,
				keyrcokApplicationOpenIDFlag,
				ngsicli.VerboseFlag,
				ngsicli.PrettyFlag,
			},
			OptionFlags: &ngsicli.ValidationFlag{Mode: ngsicli.XnorCondition, Flags: []string{"data", "name"}},
			Action: func(c *ngsicli.Context, ngsi *ngsilib.NGSI, client *ngsilib.Client) error {
				return applicationsCreate(c, ngsi, client)
			},
		},
		{
			Name:       "update",
			Usage:      "update application",
			ServerList: []string{"keyrock"},
			Flags: []ngsicli.Flag{
				keyrockApplicationIDRFlag,
				keyrcokApplicationDataFlag,
				keyrcokApplicationNameFlag,
				keyrcokApplicationDescriptionFlag,
				keyrcokApplicationURLFlag,
				keyrcokApplicationRedirectURIFlag,
				keyrcokApplicationRedirectSignOutURIFlag,
				keyrcokApplicationGrantTypeFlag,
				keyrcokApplicationTokenTypesFlag,
				keyrcokApplicationResponseTypeFlag,
				keyrcokApplicationClientTypeFlag,
				keyrcokApplicationScopeFlag,
				keyrcokApplicationOpenIDFlag,
				ngsicli.VerboseFlag,
				ngsicli.PrettyFlag,
			},
			RequiredFlags: []string{"aid"},
			Action: func(c *ngsicli.Context, ngsi *ngsilib.NGSI, client *ngsilib.Client) error {
				return applicationsUpdate(c, ngsi, client)
			},
		},
		{
			Name:       "delete",
			Usage:      "delete application",
			ServerList: []string{"keyrock"},
			Flags: []ngsicli.Flag{
				keyrockApplicationIDRFlag,
			},
			RequiredFlags: []string{"aid"},
			Action: func(c *ngsicli.Context, ngsi *ngsilib.NGSI, client *ngsilib.Client) error {
				return applicationsDelete(c, ngsi, client)
			},
		},
		&rolesCmd,
		&permissionsCmd,
		&pepProxiesCmd,
		&iotAgentCmd,
		&appsUsersCmd,
		&appsOrgsCmd,
		&trustedAppsCmd,
	},
}
View Source
var KeyrockApp = &ngsicli.App{
	Copyright: ngsicli.Copyright,
	Version:   ngsicli.Version,
	Usage:     "keyrock command",
	Flags:     ngsicli.GlobalFlags,
	Commands: []*ngsicli.Command{
		&ApplicationsCmd,
		&UsersCmd,
		&OrganizationsCmd,
		&ProvidersCmd,
	},
}
View Source
var OrganizationsCmd = ngsicli.Command{
	Name:     "organizations",
	Usage:    "manage organizations for Keyrock",
	Category: "Keyrock",
	Flags: []ngsicli.Flag{
		ngsicli.HostRFlag,
		ngsicli.OAuthTokenFlag,
	},
	Subcommands: []*ngsicli.Command{
		{
			Name:       "list",
			Usage:      "list organizations",
			ServerList: []string{"keyrock"},
			Flags: []ngsicli.Flag{
				ngsicli.VerboseFlag,
				ngsicli.PrettyFlag,
			},
			Action: func(c *ngsicli.Context, ngsi *ngsilib.NGSI, client *ngsilib.Client) error {
				return organizationsList(c, ngsi, client)
			},
		},
		{
			Name:       "get",
			Usage:      "get organization",
			ServerList: []string{"keyrock"},
			Flags: []ngsicli.Flag{
				keyrockOrganizationIDRFlag,
				ngsicli.PrettyFlag,
			},
			RequiredFlags: []string{"oid"},
			Action: func(c *ngsicli.Context, ngsi *ngsilib.NGSI, client *ngsilib.Client) error {
				return organizationsGet(c, ngsi, client)
			},
		},
		{
			Name:       "create",
			Usage:      "create organization",
			ServerList: []string{"keyrock"},
			Flags: []ngsicli.Flag{
				keyrockOrganizationNameRFlag,
				keyrockDescriptionFlag,
				keyrockWebsiteFlag,
				ngsicli.VerboseFlag,
				ngsicli.PrettyFlag,
			},
			RequiredFlags: []string{"name"},
			Action: func(c *ngsicli.Context, ngsi *ngsilib.NGSI, client *ngsilib.Client) error {
				return organizationsCreate(c, ngsi, client)
			},
		},
		{
			Name:       "update",
			Usage:      "update organization",
			ServerList: []string{"keyrock"},
			Flags: []ngsicli.Flag{
				keyrockOrganizationIDRFlag,
				keyrockOrganizationNameFlag,
				keyrockDescriptionFlag,
				keyrockWebsiteFlag,
				ngsicli.VerboseFlag,
				ngsicli.PrettyFlag,
			},
			RequiredFlags: []string{"oid"},
			Action: func(c *ngsicli.Context, ngsi *ngsilib.NGSI, client *ngsilib.Client) error {
				return organizationsUpdate(c, ngsi, client)
			},
		},
		{
			Name:       "delete",
			Usage:      "delete organization",
			ServerList: []string{"keyrock"},
			Flags: []ngsicli.Flag{
				keyrockOrganizationIDRFlag,
			},
			RequiredFlags: []string{"oid"},
			Action: func(c *ngsicli.Context, ngsi *ngsilib.NGSI, client *ngsilib.Client) error {
				return organizationsDelete(c, ngsi, client)
			},
		},
		&orgsUsersCmd,
	},
}
View Source
var ProvidersCmd = ngsicli.Command{
	Name:       "providers",
	Usage:      "print service providers for Keyrock",
	Category:   "Keyrock",
	ServerList: []string{"keyrock"},
	Flags: []ngsicli.Flag{
		ngsicli.HostRFlag,
		ngsicli.OAuthTokenFlag,
		ngsicli.PrettyFlag,
	},
	Action: func(c *ngsicli.Context, ngsi *ngsilib.NGSI, client *ngsilib.Client) error {
		return providersGet(c, ngsi, client)
	},
}
View Source
var UsersCmd = ngsicli.Command{
	Name:     "users",
	Usage:    "manage users for Keyrock",
	Category: "Keyrock",
	Flags: []ngsicli.Flag{
		ngsicli.HostRFlag,
		ngsicli.OAuthTokenFlag,
	},
	Subcommands: []*ngsicli.Command{
		{
			Name:       "list",
			Usage:      "list users",
			ServerList: []string{"keyrock"},
			Flags: []ngsicli.Flag{
				ngsicli.VerboseFlag,
				ngsicli.PrettyFlag,
			},
			Action: func(c *ngsicli.Context, ngsi *ngsilib.NGSI, client *ngsilib.Client) error {
				return usersList(c, ngsi, client)
			},
		},
		{
			Name:       "get",
			Usage:      "get user",
			ServerList: []string{"keyrock"},
			Flags: []ngsicli.Flag{
				keyrockUserIDRFlag,
				ngsicli.PrettyFlag,
			},
			RequiredFlags: []string{"uid"},
			Action: func(c *ngsicli.Context, ngsi *ngsilib.NGSI, client *ngsilib.Client) error {
				return usersGet(c, ngsi, client)
			},
		},
		{
			Name:       "create",
			Usage:      "create user",
			ServerList: []string{"keyrock"},
			Flags: []ngsicli.Flag{
				keyrockUserNameRFlag,
				keyrockPasswordRFlag,
				keyrockEmailRFlag,
				ngsicli.VerboseFlag,
				ngsicli.PrettyFlag,
			},
			RequiredFlags: []string{"username", "email", "password"},
			Action: func(c *ngsicli.Context, ngsi *ngsilib.NGSI, client *ngsilib.Client) error {
				return usersCreate(c, ngsi, client)
			},
		},
		{
			Name:       "update",
			Usage:      "update user",
			ServerList: []string{"keyrock"},
			Flags: []ngsicli.Flag{
				keyrockUserIDRFlag,
				keyrockUserNameFlag,
				keyrockPasswordFlag,
				keyrockEmailFlag,
				keyrockGravatarFlag,
				keyrockDescriptionFlag,
				keyrockWebsiteFlag,
				keyrockExtraFlag,
				ngsicli.PrettyFlag,
			},
			RequiredFlags: []string{"uid"},
			Action: func(c *ngsicli.Context, ngsi *ngsilib.NGSI, client *ngsilib.Client) error {
				return usersUpdate(c, ngsi, client)
			},
		},
		{
			Name:       "delete",
			Usage:      "delete user",
			ServerList: []string{"keyrock"},
			Flags: []ngsicli.Flag{
				keyrockUserIDRFlag,
			},
			RequiredFlags: []string{"uid"},
			Action: func(c *ngsicli.Context, ngsi *ngsilib.NGSI, client *ngsilib.Client) error {
				return usersDelete(c, ngsi, client)
			},
		},
	},
}

Functions

func NewNgsiApp

func NewNgsiApp() *ngsicli.App

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL