provider

package
v0.0.0-...-57b459a Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAuthenticator

func NewAuthenticator(tokenizer crypto.Tokenizer, timer timer.Timer, duration TokenValidDuration) authenticator.Authenticator

NewAuthenticator creates Authenticator with TokenValidDuration to uniquely identify duration during dependency injection.

func NewDataDogEntryRepo

func NewDataDogEntryRepo(
	apiKey DataDogAPIKey,
	httpRequest webreq.HTTP,
	runtime env.Runtime,
) logger.DataDogEntryRepo

NewDataDogEntryRepo creates new DataDogEntryRepo with DataDogAPIKey to uniquely identify apiKey during dependency injection.

func NewDataDogMetrics

func NewDataDogMetrics(
	apiKey DataDogAPIKey,
	httpRequest webreq.HTTP,
	timer timer.Timer,
	runtime env.Runtime,
) metrics.DataDog

NewDataDogMetrics creates new DataDog Metrics with DataDogAPIKey to uniquely identify apiKey during dependency injection.

func NewEntryRepositorySwitch

func NewEntryRepositorySwitch(
	runtime env.Runtime,
	deployment env.Deployment,
	stdOut io.StdOut,
	dataDogAPIKey DataDogAPIKey,
	httpRequest webreq.HTTP,
) logger.EntryRepository

NewEntryRepositorySwitch swaps between different entry repository implementations based on server environment.

func NewFacebookAccountLinker

func NewFacebookAccountLinker(
	factory sso.AccountLinkerFactory,
	facebookSSORepo sqldb.FacebookSSOSql,
) facebook.AccountLinker

NewFacebookAccountLinker creates FacebookAccountLinker.

func NewFacebookIdentityProvider

func NewFacebookIdentityProvider(
	req webreq.HTTP,
	clientID FacebookClientID,
	clientSecret FacebookClientSecret,
	redirectURI FacebookRedirectURI,
) facebook.IdentityProvider

NewFacebookIdentityProvider creates a new Facebook OAuth client with FacebookClientID and FacebookClientSecret to uniquely identify clientID and clientSecret during dependency injection.

func NewFacebookSSO

func NewFacebookSSO(
	ssoFactory sso.Factory,
	identityProvider facebook.IdentityProvider,
	account facebook.Account,
	linker facebook.AccountLinker,
) facebook.SingleSignOn

NewFacebookSSO creates FacebookSingleSignOn.

func NewFeatureDecisionMakerFactorySwitch

func NewFeatureDecisionMakerFactorySwitch(
	deployment env.Deployment,
	toggleRepo repository.FeatureToggle,
	authorizer authorizer.Authorizer,
) feature.DecisionMakerFactory

NewFeatureDecisionMakerFactorySwitch creates FeatureDecisionFactory based on server environment.

func NewGithubAccountLinker

func NewGithubAccountLinker(
	factory sso.AccountLinkerFactory,
	ssoMap sqldb.GithubSSOSql,
) github.AccountLinker

NewGithubAccountLinker creates GithubAccountLinker.

func NewGithubIdentityProvider

func NewGithubIdentityProvider(
	req webreq.HTTP,
	clientID GithubClientID,
	clientSecret GithubClientSecret,
) github.IdentityProvider

NewGithubIdentityProvider creates a new Github OAuth client with GithubClientID and GithubClientSecret to uniquely identify clientID and clientSecret during dependency injection.

func NewGithubSSO

func NewGithubSSO(
	ssoFactory sso.Factory,
	accountLinker github.AccountLinker,
	identityProvider github.IdentityProvider,
	account github.Account,
) github.SingleSignOn

NewGithubSSO creates GithubSingleSignOn.

func NewGoogleAccountLinker

func NewGoogleAccountLinker(
	factory sso.AccountLinkerFactory,
	googleSSORepo sqldb.GoogleSSOSql,
) google.AccountLinker

NewGoogleAccountLinker creates GoogleAccountLinker.

func NewGoogleIdentityProvider

func NewGoogleIdentityProvider(
	req webreq.HTTP,
	clientID GoogleClientID,
	clientSecret GoogleClientSecret,
	redirectURI GoogleRedirectURI,
) google.IdentityProvider

NewGoogleIdentityProvider creates a new Google OAuth client with GoogleClientID and GoogleClientSecret to uniquely identify clientID and clientSecret during dependency injection.

func NewGoogleSSO

func NewGoogleSSO(
	ssoFactory sso.Factory,
	identityProvider google.IdentityProvider,
	account google.Account,
	linker google.AccountLinker,
) google.SingleSignOn

NewGoogleSSO creates GoogleSingleSignOn.

func NewGraphQLService

func NewGraphQLService(
	gqlPath GraphQLPath,
	handler graphql.Handler,
	webUI graphql.WebUI,
	logger logger.Logger,
) service.GraphQL

NewGraphQLService creates GraphQL service with GraphQLPath to uniquely identify graphQLPath during dependency injection.

func NewGraphiQL

func NewGraphiQL(gqlPath GraphQLPath, defaultQuery GraphiQLDefaultQuery) graphql.GraphiQL

NewGraphiQL creates GraphiQL with GraphiQLDefaultQuery to uniquely identify constructor parameters during dependency injection.

func NewIPStack

func NewIPStack(
	apiKey IPStackAPIKey,
	httpRequest webreq.HTTP,
	logger logger.Logger,
) geo.IPStack

NewIPStack creates IPStack with IPStackAPIKey to uniquely identify apiKey during dependency injection.

func NewJwtGo

func NewJwtGo(secret JwtSecret) crypto.Tokenizer

NewJwtGo creates Crypto Tokenizer with JwtSecret to uniquely identify secret during dependency injection.

func NewKeyGenerator

func NewKeyGenerator(
	bufferSize KeyGenBufferSize,
	keyFetcher keygen.KeyFetcher,
) (keygen.KeyGenerator, error)

NewKeyGenerator creates KeyGenerator with KeyGenBufferSize to uniquely identify bufferSize

func NewKgsRPC

func NewKgsRPC(config KgsRPCConfig) (kgs.RPC, error)

NewKgsRPC creates RPC

func NewLocalEntryRepo

func NewLocalEntryRepo(output io.Output) logger.Local

NewLocalEntryRepo create LocalEntryRepo with line number disabled in logs.

func NewLogger

func NewLogger(
	prefix LogPrefix,
	level logger.LogLevel,
	timer timer.Timer,
	programRuntime runtime.Program,
	entryRepo logger.EntryRepository,
) logger.Logger

NewLogger creates logger with LogPrefix to uniquely identify log prefix during dependency injection.

func NewReCaptchaService

func NewReCaptchaService(req webreq.HTTP, secret ReCaptchaSecret) requester.ReCaptcha

NewReCaptchaService creates reCAPTCHA service with ReCaptchaSecret to uniquely identify secret during dependency injection.

func NewSafeBrowsing

func NewSafeBrowsing(
	apiKey GoogleAPIKey,
	httpRequest webreq.HTTP,
) google.SafeBrowsing

NewSafeBrowsing creates new SafeBrowsing with GoogleAPIKey to uniquely identify apiKey during dependency injection.

func NewSearch

func NewSearch(
	logger logger.Logger,
	shortLinkRepo repository.ShortLink,
	userShortLinkRepo repository.UserShortLink,
	timeout SearchTimeout,
) search.Search

NewSearch creates Search given its dependencies.

func NewSegment

func NewSegment(apiKey SegmentAPIKey, timer timer.Timer, logger logger.Logger) analytics.Segment

NewSegment creates Segment with SegmentAPIKey to uniquely identify apiKey during dependency injection.

func NewShortGraphQLAPI

func NewShortGraphQLAPI(
	schemaPath GraphQLSchemaPath,
	fileSystem filesystem.FileSystem,
	resolver resolver.Resolver,
) (graphql.API, error)

NewShortGraphQLAPI creates graphql.API given its dependencies.

func NewShortRoutes

func NewShortRoutes(
	instrumentationFactory request.InstrumentationFactory,
	webFrontendURL WebFrontendURL,
	timer timer.Timer,
	shortLinkRetriever shortlink.Retriever,
	featureDecisionMakerFactory feature.DecisionMakerFactory,
	githubSSO github.SingleSignOn,
	facebookSSO facebook.SingleSignOn,
	googleSSO google.SingleSignOn,
	authenticator authenticator.Authenticator,
	search search.Search,
	swaggerUIDir SwaggerUIDir,
	openAPISpecPath OpenAPISpecPath,
) []router.Route

NewShortRoutes creates HTTP routes for Short API with WwwRoot to uniquely identify WwwRoot during dependency injection.

func NewVerifier

func NewVerifier(
	deployment env.Deployment,
	service requester.ReCaptcha,
) requester.Verifier

NewVerifier creates Verifier based on server environment.

Types

type DataDogAPIKey

type DataDogAPIKey string

DataDogAPIKey represents credential for DataDog APIs.

type FacebookClientID

type FacebookClientID string

FacebookClientID represents client ID used for Facebook OAuth.

type FacebookClientSecret

type FacebookClientSecret string

FacebookClientSecret represents client secret used for Facebook OAuth.

type FacebookRedirectURI

type FacebookRedirectURI string

FacebookRedirectURI represents redirect URL for facebook single sign on.

type GithubClientID

type GithubClientID string

GithubClientID represents client ID used for Github OAuth.

type GithubClientSecret

type GithubClientSecret string

GithubClientSecret represents client secret used for Github OAuth.

type GoogleAPIKey

type GoogleAPIKey string

GoogleAPIKey represents the credential for Google APIs.

type GoogleClientID

type GoogleClientID string

GoogleClientID represents client ID used for Google OAuth.

type GoogleClientSecret

type GoogleClientSecret string

GoogleClientSecret represents client secret used for Google OAuth.

type GoogleRedirectURI

type GoogleRedirectURI string

GoogleRedirectURI represents redirect URL for Google single sign on.

type GraphQLPath

type GraphQLPath string

GraphQLPath represents the path for GraphQL APIs.

type GraphQLSchemaPath

type GraphQLSchemaPath string

GraphQLSchemaPath represents the local of GraphQL schema.

type GraphiQLDefaultQuery

type GraphiQLDefaultQuery string

GraphiQLDefaultQuery represents the default GraphQL query showing up in GraphiQL editor when it first loads.

type IPStackAPIKey

type IPStackAPIKey string

IPStackAPIKey represents credential for IP Stack APIs.

type JwtSecret

type JwtSecret string

JwtSecret represents the secret used to encode and decode JWT token.

type KeyGenBufferSize

type KeyGenBufferSize int

KeyGenBufferSize specifies the size of the local cache for fetched keys

type KgsRPCConfig

type KgsRPCConfig struct {
	Hostname string
	Port     int
}

KgsRPCConfig includes hostname and port for key generation service API

type LogPrefix

type LogPrefix string

LogPrefix represents the prefix of a log message. "[Short]" is the prefix part of the following log message: [Short] [Info] 2020-01-07 04:33:22 line 25 at service.go GraphQL API started

type OpenAPISpecPath

type OpenAPISpecPath string

OpenAPISpecPath represents the location of OpenAPI specification.

type ReCaptchaSecret

type ReCaptchaSecret string

ReCaptchaSecret represents the secret used to verify reCAPTCHA.

type SearchTimeout

type SearchTimeout time.Duration

SearchTimeout represents timeout duration of a search request.

type SegmentAPIKey

type SegmentAPIKey string

SegmentAPIKey represents credential for Segment APIs.

type SwaggerUIDir

type SwaggerUIDir string

SwaggerUIDir represents the root directory of Swagger UI static assets.

type TokenValidDuration

type TokenValidDuration time.Duration

TokenValidDuration represents the duration of a valid token.

type WebFrontendURL

type WebFrontendURL string

WebFrontendURL represents the URL of the web frontend

Jump to

Keyboard shortcuts

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