auth

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Apache-2.0, MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type QueryAuthorizer

type QueryAuthorizer struct {
	Client *metaclient.Client
}

QueryAuthorizer determines whether a user is authorized to execute a given query.

func NewQueryAuthorizer

func NewQueryAuthorizer(c *metaclient.Client) *QueryAuthorizer

NewQueryAuthorizer returns a new instance of QueryAuthorizer.

func (*QueryAuthorizer) AuthorizeDatabase

func (a *QueryAuthorizer) AuthorizeDatabase(u meta.User, priv originql.Privilege, database string) error

func (*QueryAuthorizer) AuthorizeQuery

func (a *QueryAuthorizer) AuthorizeQuery(u meta.User, query *influxql.Query, database string) error

AuthorizeQuery authorizes u to execute q on database. Database can be "" for queries that do not require a database. If no user is provided it will return an error unless the query's first statement is to create a root user.

type WriteAuthorizer

type WriteAuthorizer struct {
	Client *metaclient.Client
}

func NewWriteAuthorizer

func NewWriteAuthorizer(c *metaclient.Client) *WriteAuthorizer

NewWriteAuthorizer returns a new instance of WriteAuthorizer.

func (WriteAuthorizer) AuthorizeWrite

func (a WriteAuthorizer) AuthorizeWrite(username, database string) error

AuthorizeWrite returns nil if the user has permission to write to the database.

Jump to

Keyboard shortcuts

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