kbaseauthcontroller

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

Controller is a KBase auth service controller.

func New

func New(p Params) (*Controller, error)

New creates a new controller.

func (*Controller) CreateTestRole

func (c *Controller) CreateTestRole(role string, description string) error

CreateTestRole creates a role in the auth system

func (*Controller) CreateTestToken

func (c *Controller) CreateTestToken(username string) (string, error)

CreateTestToken creates a token for the given user

func (*Controller) CreateTestUser

func (c *Controller) CreateTestUser(username string, displayname string) error

CreateTestUser creates a test user in the auth system

func (*Controller) Destroy

func (c *Controller) Destroy(deleteTempDir bool) error

Destroy destroys the controller. If deleteTempDir is true, all files created by the controller will be removed.

func (*Controller) GetPort

func (c *Controller) GetPort() int

GetPort returns the port on which MongoDB is listening.

func (*Controller) SetTestUserRoles

func (c *Controller) SetTestUserRoles(username string, roles *[]string) error

SetTestUserRoles sets custom roles for a test user and removes all built-in roles.

type Params

type Params struct {
	// Auth2Jar is the path to the kbase auth2 jar.
	Auth2Jar string
	// MongoHost is the mongo host.
	MongoHost string
	// MongoDatabase is the database to use for auth data.
	MongoDatabase string
	// RootTempDir is where temporary files should be placed.
	RootTempDir string
}

Params are Parameters for creating a KBase Auth2 service (https://github.com/kbase/auth2) controller.

Jump to

Keyboard shortcuts

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