Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UnmarshalLoginRule ¶
func UnmarshalLoginRule(raw []byte) (*loginrulepb.LoginRule, error)
UnmarshalLoginRule parses a login rule in the Resource format which matches the expected YAML format for Teleport resources, sets default values, and converts to *loginrulepb.LoginRule.
Types ¶
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
Command implements all commands under "tctl login_rule".
func (*Command) Initialize ¶
func (t *Command) Initialize(app *kingpin.Application, cfg *servicecfg.Config)
Initialize installs the base "login_rule" command and all subcommands.
type Resource ¶
type Resource struct { // ResourceHeader is embedded to implement types.Resource types.ResourceHeader // Spec is the login rule specification Spec spec `json:"spec"` }
Resource is a type to represent login rules which implements types.Resource and custom YAML (un)marshaling. This satisfies the expected YAML format for the resource, which would be hard/impossible to do for loginrulepb.LoginRule directly. Specifically, protoc-gen-go does not have good support for parsing a map[string][]string from YAML.
func ProtoToResource ¶
func ProtoToResource(rule *loginrulepb.LoginRule) *Resource
ProtoToResource converts a *loginrulepb.LoginRule into a *Resource which implements types.Resource and can be marshaled to YAML or JSON in a human-friendly format.
func (*Resource) CheckAndSetDefaults ¶
CheckAndSetDefaults sanity checks Resource fields to catch simple errors, and sets default values for all fields with defaults.