api

package
v0.0.0-...-fb7f86c Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetLDAPUserParams

type GetLDAPUserParams struct {
	// in:path
	// required:true
	UserName string `json:"user_name"`
}

swagger:parameters getUserFromLDAP

type LDAPAttribute

type LDAPAttribute struct {
	ConfigAttributeValue string `json:"cfgAttrValue"`
	LDAPAttributeValue   string `json:"ldapValue"`
}

LDAPAttribute is a serializer for user attributes mapped from LDAP. Is meant to display both the serialized value and the LDAP key we received it from.

type LDAPRoleDTO

type LDAPRoleDTO struct {
	OrgId   int64        `json:"orgId"`
	OrgName string       `json:"orgName"`
	OrgRole org.RoleType `json:"orgRole"`
	GroupDN string       `json:"groupDN"`
}

RoleDTO is a serializer for mapped roles from LDAP

type LDAPServerDTO

type LDAPServerDTO struct {
	Host      string `json:"host"`
	Port      int    `json:"port"`
	Available bool   `json:"available"`
	Error     string `json:"error"`
}

LDAPServerDTO is a serializer for LDAP server statuses

type LDAPUserDTO

type LDAPUserDTO struct {
	Name           *LDAPAttribute         `json:"name"`
	Surname        *LDAPAttribute         `json:"surname"`
	Email          *LDAPAttribute         `json:"email"`
	Username       *LDAPAttribute         `json:"login"`
	IsGrafanaAdmin *bool                  `json:"isGrafanaAdmin"`
	IsDisabled     bool                   `json:"isDisabled"`
	OrgRoles       []LDAPRoleDTO          `json:"roles"`
	Teams          []ldap.TeamOrgGroupDTO `json:"teams"`
}

LDAPUserDTO is a serializer for users mapped from LDAP

type OrganizationNotFoundError

type OrganizationNotFoundError struct {
	OrgID int64
}

func (*OrganizationNotFoundError) Error

func (e *OrganizationNotFoundError) Error() string

type Service

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

func ProvideService

func ProvideService(cfg *setting.Cfg, router routing.RouteRegister, accessControl ac.AccessControl,
	userService user.Service, authInfoService login.AuthInfoService, ldapGroupsService ldap.Groups,
	loginService login.Service, orgService org.Service, ldapService service.LDAP,
	sessionService auth.UserTokenService, bundleRegistry supportbundles.Service) *Service

func (*Service) GetLDAPStatus

func (s *Service) GetLDAPStatus(c *contextmodel.ReqContext) response.Response

swagger:route GET /admin/ldap/status admin_ldap getLDAPStatus

Attempts to connect to all the configured LDAP servers and returns information on whenever they're available or not.

If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `ldap.status:read`.

Security: - basic:

Responses: 200: okResponse 401: unauthorisedError 403: forbiddenError 500: internalServerError

func (*Service) GetUserFromLDAP

func (s *Service) GetUserFromLDAP(c *contextmodel.ReqContext) response.Response

swagger:route GET /admin/ldap/{user_name} admin_ldap getUserFromLDAP

Finds an user based on a username in LDAP. This helps illustrate how would the particular user be mapped in Grafana when synced.

If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `ldap.user:read`.

Security: - basic:

Responses: 200: okResponse 401: unauthorisedError 403: forbiddenError 500: internalServerError

func (*Service) PostSyncUserWithLDAP

func (s *Service) PostSyncUserWithLDAP(c *contextmodel.ReqContext) response.Response

swagger:route POST /admin/ldap/sync/{user_id} admin_ldap postSyncUserWithLDAP

Enables a single Grafana user to be synchronized against LDAP.

If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `ldap.user:sync`.

Security: - basic:

Responses: 200: okResponse 401: unauthorisedError 403: forbiddenError 500: internalServerError

func (*Service) ReloadLDAPCfg

func (s *Service) ReloadLDAPCfg(c *contextmodel.ReqContext) response.Response

swagger:route POST /admin/ldap/reload admin_ldap reloadLDAPCfg

Reloads the LDAP configuration.

If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `ldap.config:reload`.

Security: - basic:

Responses: 200: okResponse 401: unauthorisedError 403: forbiddenError 500: internalServerError

type SyncLDAPUserParams

type SyncLDAPUserParams struct {
	// in:path
	// required:true
	UserID int64 `json:"user_id"`
}

swagger:parameters postSyncUserWithLDAP

Jump to

Keyboard shortcuts

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