slickconfig

package
v0.0.0-...-04802e6 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PERMISSION_ADMIN uint32 = 1 << iota
	PERMISSION_BUILD_WRITE
	PERMISSION_BUILD_DELETE
	PERMISSION_TESTCASE_WRITE
	PERMISSION_TESTCASE_DELETE
	PERMISSION_TESTPLAN_WRITE
	PERMISSION_TESTPLAN_DELETE
	PERMISSION_TESTRUN_WRITE
	PERMISSION_TESTRUN_DELETE
	PERMISSION_RESULT_WRITE
	PERMISSION_RESULT_DELETE
	PERMISSION_REPORT_GENERATE
)
View Source
const (
	ConfigurationEnvironmentVariableName = "SLICKCONF"
)

Variables

View Source
var (
	DefaultRoles = []Role{
		Role{
			Name:        "Project Admin",
			Description: "An admin of a project has complete control over it.",
			Permission:  PERMISSION_ADMIN,
		},
		Role{
			Name:        "Tester",
			Description: "An admin of a project has complete control over it.",
			Permission:  PERMISSION_RESULT_WRITE | PERMISSION_TESTCASE_WRITE,
		},
		Role{
			Name:        "Test Manager",
			Description: "Someone who can organize and kick off tests, and fix other's mistakes (delete tests, and testplans)",
			Permission:  PERMISSION_BUILD_WRITE | PERMISSION_RESULT_WRITE | PERMISSION_TESTCASE_WRITE | PERMISSION_TESTCASE_DELETE | PERMISSION_TESTPLAN_WRITE | PERMISSION_TESTPLAN_DELETE | PERMISSION_TESTRUN_WRITE,
		},
		Role{
			Name:        "Report Generator",
			Description: "Can generate the read only reports for others to view.",
			Permission:  PERMISSION_REPORT_GENERATE,
		},
		Role{
			Name:        "Result Deleter",
			Description: "Can delete results, testruns, and builds (dangerous)",
			Permission:  PERMISSION_RESULT_DELETE | PERMISSION_TESTRUN_DELETE | PERMISSION_BUILD_DELETE,
		},
		Role{
			Name:        "Build Engineer",
			Description: "Can create new builds",
			Permission:  PERMISSION_BUILD_WRITE,
		},
	}
)

Functions

func DescribePermission

func DescribePermission(permission uint32) string

func GetPermissionName

func GetPermissionName(permission uint32) string

func GetPermissionNames

func GetPermissionNames(permission uint32) (retval []string)

func PermissionFromRoles

func PermissionFromRoles(userroles []string) uint32

Types

type AuthenticationEncryptionConfiguration

type AuthenticationEncryptionConfiguration struct {
	JWTPrivateKey string `` /* 126-byte string literal not displayed */
	JWTPublicKey  string `` /* 139-byte string literal not displayed */
}

type DefaultAccessConfiguration

type DefaultAccessConfiguration struct {
	Company  string   `toml:"company-name" comment:"The company name for the projects you want to give access to."`
	Projects []string `toml:"projects" comment:"The list of projects you want every user who logs in to have read only access to."`
	Admin    string   `` /* 129-byte string literal not displayed */
}

type GoogleOauthConfiguration

type GoogleOauthConfiguration struct {
	ClientID string `toml:"client-id" comment:"ClientID from google for authentication."`
	Secret   string `toml:"secret" comment:"Secret from google for authentication."`
}

type MongoConfiguration

type MongoConfiguration struct {
	URL                      string `` /* 156-byte string literal not displayed */
	Database                 string `toml:"database" comment:"The name of the database to use for slick."`
	UseTLS                   bool   `` /* 185-byte string literal not displayed */
	RootCertificatesLocation string `` /* 133-byte string literal not displayed */
}

type Role

type Role struct {
	Name        string `toml:"name"`
	Description string `toml:"description"`
	Permission  uint32 `toml:"permission"`
}

type RolesConfiguration

type RolesConfiguration struct {
	Defaults []Role `toml:"default-roles" comment:"The default roles that slick gives (can be customized per-project)."`
}

type ServiceConfiguration

type ServiceConfiguration struct {
	BaseUrl           string `toml:"base-url" comment:"You must supply a base url for slick.  If you change it you have to regenerate certificates."`
	ListenIP          string `toml:"listen-ip" comment:"The IP address to listen on.  If you want to listen on all interfaces use 0.0.0.0."`
	ListenPort        int    `` /* 150-byte string literal not displayed */
	LocalWebFilesPath string `` /* 169-byte string literal not displayed */
}

type SlickConfiguration

type SlickConfiguration struct {
	Common          ServiceConfiguration                  `toml:"common"`
	DefaultAccess   DefaultAccessConfiguration            `toml:"default-access"`
	Google          GoogleOauthConfiguration              `` /* 208-byte string literal not displayed */
	Mongo           MongoConfiguration                    `toml:"mongo"`
	Roles           RolesConfiguration                    `toml:"roles"`
	TLSEncryption   TLSEncryptionConfiguration            `toml:"tls-encryption"`
	TokenEncryption AuthenticationEncryptionConfiguration `toml:"token-encryption"`
}
var (
	Configuration SlickConfiguration
)

func (*SlickConfiguration) Load

func (c *SlickConfiguration) Load(data []byte)

func (*SlickConfiguration) LoadFromLocation

func (c *SlickConfiguration) LoadFromLocation(location string)

func (*SlickConfiguration) LoadFromStandardLocations

func (c *SlickConfiguration) LoadFromStandardLocations()

func (*SlickConfiguration) ToBytes

func (c *SlickConfiguration) ToBytes() ([]byte, error)

type TLSEncryptionConfiguration

type TLSEncryptionConfiguration struct {
	TLSPrivateKey  string `toml:"tls-private-key" comment:"The private key for tls encryption."`
	TLSCertificate string `toml:"tls-certificate" comment:"The certificate for tls encryption."`
}

Jump to

Keyboard shortcuts

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