natsperms

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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 Deps

type Deps struct {
	Config config.Config
}

Deps is what get uses: the config.

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.

func Get

func Get(
	_ context.Context,
	d Deps,
	in GetInput,
) (GetOutput, error)

Get is the subjects of the role, for the streams and buckets of the config under the namespace of controller.nats.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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