security

package
v0.0.0-...-4518f94 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 13 Imported by: 8

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func ApiKeyCheckerGRPC

func ApiKeyCheckerGRPC(ctx context.Context, appKeyRepo postgresRepository.AppKeyRepository, app App) bool

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"
	ANTHROPIC_API        App = "anthropic-api"
	OPENAI_API           App = "openai-api"
	PLATFORM_ADMIN_API   App = "platform-admin-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