security

package
v0.0.0-...-679f9ba Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 10 Imported by: 14

Documentation

Index

Constants

View Source
const (
	ApiKeyHeader       = "X-Openline-API-KEY"
	TenantApiKeyHeader = "X-CUSTOMER-OS-API-KEY"
)
View Source
const (
	KEY_TENANT_NAME = "TenantName"
	KEY_USER_ID     = "UserId"
	KEY_USER_EMAIL  = "UserEmail"
	KEY_USER_ROLES  = "UserRoles"
	KEY_APP_SOURCE  = "AppSource"
)
View Source
const TenantHeader = "X-Openline-TENANT"
View Source
const UsernameHeader = "X-Openline-USERNAME"

Variables

This section is empty.

Functions

func ApiKeyCheckerHTTP

func ApiKeyCheckerHTTP(tenantApiKeyRepo postgresRepository.TenantWebhookApiKeyRepository, appKeyRepo postgresRepository.AppKeyRepository, app App, opts ...CommonServiceOption) func(c *gin.Context)

func TenantUserContextEnhancer

func TenantUserContextEnhancer(headerAllowance HeaderAllowance, cr *neo4jrepository.Repositories, opts ...CommonServiceOption) func(c *gin.Context)

Types

type App

type App string
const (
	CUSTOMER_OS_API      App = "customer-os-api"
	CUSTOMER_OS_WEBHOOKS App = "customer-os-webhooks"
	FILE_STORE_API       App = "file-store-api"
	SETTINGS_API         App = "settings-api"
	VALIDATION_API       App = "validation-api"
	AI_API               App = "ai-api"
	PLATFORM_ADMIN_API   App = "platform-admin-api"
	USER_ADMIN_API       App = "user-admin-api"
	ENRICHMENT_API       App = "enrichment-api"
)

type CommonServiceOption

type CommonServiceOption func(*Options)

func WithCache

func WithCache(c *caches.Cache) CommonServiceOption

WithCache is an ApiKeyCheckerOption to set the cache

type HeaderAllowance

type HeaderAllowance string
const (
	USERNAME           HeaderAllowance = "USERNAME"
	TENANT             HeaderAllowance = "TENANT"
	USERNAME_OR_TENANT HeaderAllowance = "USERNAME_OR_TENANT"
)

type Options

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

Jump to

Keyboard shortcuts

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