Documentation
¶
Index ¶
- Constants
- type APIKeyLevel
- type IPermitConfig
- type PermitBuilder
- type PermitConfig
- func (c *PermitConfig) Build() PermitConfig
- func (c *PermitConfig) GetApiUrl() string
- func (c *PermitConfig) GetContext() *PermitContext
- func (c *PermitConfig) GetDebug() bool
- func (c *PermitConfig) GetHTTPClient() *http.Client
- func (c *PermitConfig) GetLogger() *zap.Logger
- func (c *PermitConfig) GetOpaUrl() string
- func (c *PermitConfig) GetPdpUrl() string
- func (c *PermitConfig) GetToken() string
- func (c *PermitConfig) WithApiUrl(apiUrl string) *PermitConfig
- func (c *PermitConfig) WithContext(context *PermitContext) *PermitConfig
- func (c *PermitConfig) WithDebug(debug bool) *PermitConfig
- func (c *PermitConfig) WithHTTPClient(client *http.Client) *PermitConfig
- func (c *PermitConfig) WithLogger(logger *zap.Logger) *PermitConfig
- func (c *PermitConfig) WithOpaUrl(opaUrl string) *PermitConfig
- func (c *PermitConfig) WithPdpUrl(pdpUrl string) *PermitConfig
- func (c *PermitConfig) WithTimeout(timeout time.Duration) *PermitConfig
- type PermitContext
- type PermitContextInterface
Constants ¶
View Source
const ( DefaultApiUrl = "https://api.permit.io" DefaultDebugMode = false DefaultPdpUrl = "http://localhost:7766" DefaultOpaUrl = "http://localhost:8181" DefaultTimeout = time.Second * 5 )
Default Builder consts
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIKeyLevel ¶
type APIKeyLevel int
const ( NoneAPIKeyLevel APIKeyLevel = iota OrganizationAPIKeyLevel ProjectAPIKeyLevel EnvironmentAPIKeyLevel )
func GetApiKeyLevel ¶
func GetApiKeyLevel(scope *models.APIKeyScopeRead) APIKeyLevel
type IPermitConfig ¶
type PermitBuilder ¶
type PermitBuilder struct {
PermitConfig
}
func NewConfigBuilder ¶
func NewConfigBuilder(token string) *PermitBuilder
type PermitConfig ¶
type PermitConfig struct {
Context *PermitContext
Logger *zap.Logger
// contains filtered or unexported fields
}
func NewPermitConfig ¶
func NewPermitConfig(apiUrl string, token string, pdpUrl string, debug bool, context *PermitContext, logger *zap.Logger) *PermitConfig
func (*PermitConfig) Build ¶
func (c *PermitConfig) Build() PermitConfig
func (*PermitConfig) GetApiUrl ¶
func (c *PermitConfig) GetApiUrl() string
func (*PermitConfig) GetContext ¶
func (c *PermitConfig) GetContext() *PermitContext
func (*PermitConfig) GetDebug ¶
func (c *PermitConfig) GetDebug() bool
func (*PermitConfig) GetHTTPClient ¶ added in v0.0.10
func (c *PermitConfig) GetHTTPClient() *http.Client
func (*PermitConfig) GetLogger ¶
func (c *PermitConfig) GetLogger() *zap.Logger
func (*PermitConfig) GetOpaUrl ¶ added in v0.0.4
func (c *PermitConfig) GetOpaUrl() string
func (*PermitConfig) GetPdpUrl ¶
func (c *PermitConfig) GetPdpUrl() string
func (*PermitConfig) GetToken ¶
func (c *PermitConfig) GetToken() string
func (*PermitConfig) WithApiUrl ¶
func (c *PermitConfig) WithApiUrl(apiUrl string) *PermitConfig
func (*PermitConfig) WithContext ¶
func (c *PermitConfig) WithContext(context *PermitContext) *PermitConfig
func (*PermitConfig) WithDebug ¶
func (c *PermitConfig) WithDebug(debug bool) *PermitConfig
func (*PermitConfig) WithHTTPClient ¶ added in v0.0.10
func (c *PermitConfig) WithHTTPClient(client *http.Client) *PermitConfig
func (*PermitConfig) WithLogger ¶
func (c *PermitConfig) WithLogger(logger *zap.Logger) *PermitConfig
func (*PermitConfig) WithOpaUrl ¶ added in v0.0.4
func (c *PermitConfig) WithOpaUrl(opaUrl string) *PermitConfig
func (*PermitConfig) WithPdpUrl ¶ added in v0.0.2
func (c *PermitConfig) WithPdpUrl(pdpUrl string) *PermitConfig
func (*PermitConfig) WithTimeout ¶ added in v1.0.5
func (c *PermitConfig) WithTimeout(timeout time.Duration) *PermitConfig
type PermitContext ¶
type PermitContext struct {
APIKeyLevel APIKeyLevel
ProjectId string
EnvironmentId string
}
func NewPermitContext ¶
func NewPermitContext(apiKeyLevel APIKeyLevel, project string, environment string) *PermitContext
func PermitContextFactory ¶
func (*PermitContext) GetContext ¶
func (p *PermitContext) GetContext() *PermitContext
func (*PermitContext) GetEnvironment ¶
func (p *PermitContext) GetEnvironment() string
func (*PermitContext) GetProject ¶
func (p *PermitContext) GetProject() string
func (*PermitContext) SetPermitContext ¶ added in v0.0.4
func (p *PermitContext) SetPermitContext(project string, environment string, apiKeyLevel APIKeyLevel)
type PermitContextInterface ¶
type PermitContextInterface interface {
SetPermitContext(project string, environment string, apiKeyLevel APIKeyLevel)
GetProject() string
GetEnvironment() string
GetContext() *PermitContext
}
Click to show internal directories.
Click to hide internal directories.