Documentation
¶
Overview ¶
Package natsperms is the permissions group under osapi nats: osapi nats permissions get, which prints the NATS subjects that one osapi process needs, for a NATS server that osapi does not run (osapi-io/osapi#1415).
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Group = command.Register(command.Define( "permissions", "Print the NATS subjects that each osapi process needs", command.Under(command.ParentNATS), command.Uses[Deps](), command.Method[GetInput, GetOutput]("get"). Short("Print the NATS subjects that one osapi process needs"). Long("It prints the least that the role can publish and subscribe to, with the\n"+ "streams and buckets of the config and the namespace of `controller.nats`.\n"+ "Give these to the NATS user of the role on a NATS server that osapi does\n"+ "not run. `nsc` is the flags of `nsc add user` or `nsc edit user`, for a\n"+ "server in operator mode. The embedded server applies them itself to a user\n"+ "with a `role` in `nats.server.auth.users`."). Example("--role agent"). Prints(sampleGet). Example("--role controller --json"). Fails("no role", GetInput{}). Fails("a role that osapi does not have", GetInput{Role: "admin"}). Handle(Get), ))
Group is the permissions group's definition.
Functions ¶
This section is empty.
Types ¶
type GetInput ¶
type GetInput struct {
Role string `json:"role" validate:"required,oneof=controller agent setup join" doc:"The osapi process: controller, agent, setup or join"`
}
GetInput is the input of get.
type GetOutput ¶
type GetOutput struct {
Role string ` json:"role"`
Namespace string ` json:"namespace"`
Publish []string ` json:"publish"`
Subscribe []string ` json:"subscribe"`
Responses bool ` json:"responses" label:"Answers requests"`
NSC string ` json:"nsc" label:"nsc"`
// contains filtered or unexported fields
}
GetOutput is the subjects of a role.