Skip to main content

RelyAuth Reference

RelyAuthConfig

RelyAuthConfig is the data structure for authentication configurations.

KeyValueRequiredDescription
versionv1trueVersion of the authentication config.
kindRelyAuthtrueKind of the resource which is always RelyAuth.
definitionRelyAuthDefinitiontrueList of authenticator configurations.

RelyAuthDefinition

RelyAuthDefinition defines authentication modes and settings.

KeyValueRequiredDescription
settingsRelyAuthSettingsfalseGlobal settings of the auth config.
modes[RelyAuthMode]trueList of authenticator modes.

RelyAuthMode

One of the following values:

ValueDescription
RelyAuthAPIKeyConfigConfigurations for HTTP authentication with static secrets
RelyAuthJWTConfigConfigurations to which the incoming JWT will be verified and decoded to extract the session variable claims
RelyAuthNoAuthConfigThe session variables configuration for unauthenticated users
RelyAuthWebhookConfigConfigurations for the webhook authentication mode

RelyAuthWebhookConfig

Configurations for the webhook authentication mode

KeyValueRequiredDescription
modewebhooktrueAuthentication mode which is always webhook
descriptionstringfalseBrief description of the auth config
urlEnvStringtrueThe URL of the authentication webhook
httpClientHTTPClientConfigfalseConfigurations for the HTTP client
customResponseWebhookAuthCustomResponseConfigfalseThe configuration for transforming response bodies
securityRulesRelyAuthSecurityRulesConfigfalseConfigurations for extra security rules

WebhookAuthCustomResponseConfig

WebhookAuthCustomResponseConfig is the configuration for transforming response bodies.

KeyValueRequiredDescription
responseTemplateTransformerConfigfalseThe template to transform the response body.

TemplateTransformerConfig

The template to transform the response body.

One of the following values:

ValueDescription
TemplateTransformerJMESPathConfigTransform responses using the standard JMESPath template
TemplateTransformerGoTemplateConfigTransform responses using the standard Go template

TemplateTransformerGoTemplateConfig

Transform responses using the standard Go template

KeyValueRequiredDescription
typegotmpltrueTemplate type to be used for transforming response
contentTypestringtrueThe expected content type to be transformed
templatestringtrueTemplate content to be transformed

TemplateTransformerJMESPathConfig

Transform responses using the standard JMESPath template

KeyValueRequiredDescription
typejmespathtrueTemplate type to be used for transforming response
templateFieldMappingConfigtrueTemplate content to be transformed

FieldMappingConfig

Represents a generic field mapping config

One of the following values:

ValueDescription
FieldMappingObjectConfigMapping configurations for object fields
FieldMappingEntryConfigThe mapping configuration for an entry field

FieldMappingObjectConfig

FieldMappingObjectConfig represents configurations for the object field mapping.

KeyValueRequiredDescription
propertiesmap[string]anytrueProperties of the field mapping object.
typeobjecttrueType of the field mapping config

HTTPClientConfig

HTTPClientConfig contains configurations to create client.

KeyValueRequiredDescription
timeoutstringfalseDefault maximum timeout duration that is applied for all requests.
transportHTTPTransportConfigfalseTransport stores the http.Transport configuration for the http client.
tlsTLSConfigfalseThe transport layer security (LTS) configuration for the mutualTLS authentication.
retryHTTPRetryConfigfalseRetry policy of client requests.
authenticationHTTPClientAuthConfigfalseAuthentication configuration.

HTTPClientAuthConfig

Define authentication configurations

One of the following values:

ValueDescription
BasicAuthConfigConfiguration for the basic authentication
HTTPAuthConfigConfiguration for the http and API Key authentication
OAuth2ConfigConfiguration for the OAuth2 authentication

OAuth2Config

OAuth2Config contains configurations for OAuth 2.0 with client_credentials type.

KeyValueRequiredDescription
typeoauth2trueType of the oauth2 authenticator.
flowsOAuth2FlowstrueAn object containing configuration information for the flow types supported.
descriptionstringfalseA description for security scheme.
tokenLocationTokenLocationfalseThe location where the auth credential will be injected.

OAuth2Flows

OAuth2Flows contain configuration information for the flow types supported.

KeyValueRequiredDescription
clientCredentialsClientCredentialsOAuthFlowtrueOAuth2 flow for client_credentials

ClientCredentialsOAuthFlow

ClientCredentialsOAuthFlow contains flow configurations for OAuth 2.0 client credential flow.

KeyValueRequiredDescription
tokenUrlEnvStringfalseThe token URL to be used for this flow. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS.
refreshUrlEnvStringfalseThe URL to be used for obtaining refresh tokens. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS.
scopes[string]falseThe available scopes for the OAuth2 security scheme.
clientIdEnvStringfalseClient ID of the OAuth2 client.
clientSecretEnvStringfalseClient secret of the OAuth2 client.
endpointParamsmap[string]EnvStringfalseOptional query parameters for the endpoint.

HTTPAuthConfig

HTTPAuthConfig contains configurations for http authentication If the scheme is bearer, the authenticator follows OpenAPI 3 specification.

KeyValueRequiredDescription
inheader / query / cookietrueThe location enum for setting authentication value
namestringtrueName of the field to validate, for example, Authorization header.
schemestringfalseThe name of the HTTP Authentication scheme to be used in the Authorization header as defined in RFC7235. The values used SHOULD be registered in the IANA Authentication Scheme registry. https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml The value is case-insensitive, as defined in RFC7235.
typehttptrueType of the http authenticator.
valueEnvStringtrueValue of the access token.
descriptionstringfalseA description for security scheme.

BasicAuthConfig

BasicAuthConfig contains configurations for the basic authentication.

KeyValueRequiredDescription
typebasictrueType of the basic authenticator.
headerstringfalseHeader where the credential will be set.
usernameEnvStringtrueUsername to authenticate.
passwordEnvStringtruePassword to authenticate.
descriptionstringfalseA description for security scheme.

HTTPRetryConfig

HTTPRetryConfig represents retry policy settings.

KeyValueRequiredDescription
maxAttemptsEnvIntfalseMaximum number of retry attempts.
delayintegerfalseThe initial wait time in milliseconds before a retry is attempted. Must be >0. Defaults to 1 second.
maxDelayintegerfalseThe max delay in milliseconds of the exponentially backing off. If the max delay is smaller or equal the base delay. The delay is constant.
httpStatus[integer]falseHTTPStatus retries if the remote service returns one of these http status
multipliernumberfalseHow much should the reconnection time grow on subsequent attempts. Must be >=1; 1 = constant interval. Defaults to 1.5.
jitterintegerfalseFor each retry delay, a random portion of the jitter will be added or subtracted to the delay. For example: a jitter of 100 milliseconds will randomly add between -100 and 100 milliseconds to each retry delay. Replaces any previously configured jitter factor.
jitterFactornumberfalseFor each retry delay, a random portion of the delay multiplied by the jitterFactor will be added or subtracted to the delay. For example: a retry delay of 100 milliseconds and a jitterFactor of .25 will result in a random retry delay between 75 and 125 milliseconds. Replaces any previously configured jitter duration.

EnvInt

Maximum number of retry attempts.

KeyValueRequiredDescription
valueintegerfalseDefault literal value if the env is empty
envstringfalseEnvironment variable to be evaluated

TLSConfig

TLSConfig represents the transport layer security (LTS) configuration for the mutualTLS authentication.

KeyValueRequiredDescription
rootCAFile[EnvString]falseRootCAFile represents paths to root certificates. For a client this verifies the server certificate. For a server this verifies client certificates. If empty uses system root CA.
rootCAPem[EnvString]falseRootCAPem is the alternative to rootCAFile. Provide the CA cert contents as a base64-encoded string instead of a filepath.
caFile[EnvString]falseCAFile is the path to the CA cert. For a client this verifies the server certificate. For a server this verifies client certificates. If empty uses system root CA.
caPem[EnvString]falseCAPem is alternative to caFile. Provide the CA cert contents as a base64-encoded string instead of a filepath.
certificates[TLSClientCertificate]falseCertificates contains the list of client certificates.
insecureSkipVerifyEnvBoolfalseInsecureSkipVerify you can configure TLS to be enabled but skip verifying the server's certificate chain.
includeSystemCACertsPoolEnvBoolfalseIncludeSystemCACertsPool whether to load the system certificate authorities pool alongside the certificate authority.
minVersionstringfalseMinimum acceptable TLS version.
maxVersionstringfalseMaximum acceptable TLS version.
cipherSuites[string]falseExplicit cipher suites can be set. If left blank, a safe default list is used. See https://go.dev/src/crypto/tls/cipher_suites.go for a list of supported cipher suites.
serverNameEnvStringfalseServerName requested by client for virtual hosting. This sets the ServerName in the TLSConfig. Please refer to https://godoc.org/crypto/tls#Config for more information. (optional)

EnvBool

InsecureSkipVerify you can configure TLS to be enabled but skip verifying the server's certificate chain.

KeyValueRequiredDescription
valuebooleanfalseDefault literal value if the env is empty
envstringfalseEnvironment variable to be evaluated

TLSClientCertificate

TLSClientCertificate represents a cert and key pair certificate.

KeyValueRequiredDescription
certFileEnvStringfalseCertFile is the path to the TLS cert to use for TLS required connections.
certPemEnvStringfalseCertPem is alternative to certFile. Provide the certificate contents as a base64-encoded string instead of a filepath.
keyFileEnvStringfalseKeyFile is the path to the TLS key to use for TLS required connections.
keyPemEnvStringfalseKeyPem is the alternative to keyFile. Provide the key contents as a base64-encoded string instead of a filepath.

HTTPTransportConfig

HTTPTransportConfig stores the http.Transport configuration for the http client.

KeyValueRequiredDescription
dialerHTTPDialerConfigfalseOptions the http.Dialer to connect to an address
idleConnTimeoutstringfalseIdle connection timeout. The maximum amount of time an idle (keep-alive) connection will remain idle before closing itself. Zero means no limit.
responseHeaderTimeoutstringfalseResponse header timeout, if non-zero, specifies the amount of time to wait for a server's response headers after fully writing the request (including its body, if any). This time does not include the time to read the response body. This timeout is used to cover cases where the tcp connection works but the server never answers.
tlsHandshakeTimeoutstringfalseTLS handshake timeout is the maximum amount of time to wait for a TLS handshake. Zero means no timeout.
expectContinueTimeoutstringfalseExpect continue timeout, if non-zero, specifies the amount of time to wait for a server's first response headers after fully writing the request headers if the request has an "Expect: 100-continue" header.
maxIdleConnsintegerfalse
maxIdleConnsPerHostintegerfalse
maxConnsPerHostintegerfalse
maxResponseHeaderBytesintegerfalse
readBufferSizeintegerfalse
writeBufferSizeintegerfalse
disableKeepAlivesbooleanfalseDisableKeepAlives, if true, disables HTTP keep-alives and will only use the connection to the server for a single HTTP request. This is unrelated to the similarly named TCP keep-alives.
forceAttemptHTTP2booleanfalseForceAttemptHTTP2 controls whether HTTP/2 is enabled when a non-zero Dial, DialTLS, or DialContext func or TLSClientConfig is provided. Default is true.

HTTPDialerConfig

HTTPDialerConfig contains options the http.Dialer to connect to an address.

KeyValueRequiredDescription
timeoutstringfalseThe maximum amount of time a dial will wait for a connect to complete. If Deadline is also set, it may fail earlier.
keepAliveEnabledbooleanfalseKeep-alive probes are enabled by default.
keepAliveIntervalstringfalseKeepAliveInterval is the time between keep-alive probes. If zero, a default value of 15 seconds is used.
keepAliveCountintegerfalse
keepAliveIdlestringfalseKeepAliveIdle is the time that the connection must be idle before the first keep-alive probe is sent. If zero, a default value of 15 seconds is used.
fallbackDelaystringfalseFallbackDelay specifies the length of time to wait before spawning a RFC 6555 Fast Fallback connection. That is, this is the amount of time to wait for IPv6 to succeed before assuming that IPv6 is misconfigured and falling back to IPv4. If zero, a default delay of 300ms is used. A negative value disables Fast Fallback support.

RelyAuthNoAuthConfig

RelyAuthNoAuthConfig contains the session variables configuration for unauthenticated users.

KeyValueRequiredDescription
idstringfalseUnique identity of the auth config. If not set, ID will be the index of the array.
modenoAuthtrueAuthentication mode which is always noAuth.
sessionVariablesmap[string]EnvAnytrueCustom session variables for this auth mode.
securityRulesRelyAuthSecurityRulesConfigfalseConfigurations for extra security rules

RelyAuthJWTConfig

RelyAuthJWTConfig holds configurations to which the incoming JWT will be verified and decoded to extract the session variable claims.

KeyValueRequiredDescription
idstringfalseUnique identity of the auth config. If not set, ID will be the index of the array.
modejwttrueAuthentication mode which is always jwt.
descriptionstringfalseBrief description of the auth config.
audience[string]falseValidation to check that the aud field is a member of the audience received, otherwise will throw error. Required if there are many JWT auth configurations.
issuerstringfalseValidation to check that the iss field is a member of the iss received, otherwise will throw error. Required if there are many JWT auth configurations.
allowedSkewintegerfalseThe allowed leeway (in seconds) to the exp validation to account for clock skew.
tokenLocationTokenLocationtrueSource of the JWT authentication token.
keyJWTKeytrueInformation of the JWT key to verify the token.
claimsConfigJWTClaimsConfigtrueConfiguration to describe how and where the engine should look for the claims within the decoded token. You can vary the format and location of the claims.
securityRulesRelyAuthSecurityRulesConfigfalseConfigurations for extra security rules

JWTClaimsConfig

JWTClaimsConfig represents the claims config. Either specified via claims mappings or namespace.

KeyValueRequiredDescription
namespaceJWTClaimsNamespacefalseUsed when all of JWT claims are present in a single object within the decoded JWT.
locationsmap[string]FieldMappingEntryConfigfalseCan be used when JWT claims are not all present in the single object, but individual claims are provided a JSON pointer within the decoded JWT and optionally a default value.

FieldMappingEntryConfig

FieldMappingEntryConfig is the entry config to lookup field values with the specified JMES path.

KeyValueRequiredDescription
pathstringfalseJMESPath expression to find a value in the input data
defaultEnvAnyfalseDefault value to be used when no value is found
typefieldtrueType of the field mapping config

JWTClaimsNamespace

JWTClaimsNamespace is used when all of JWT claims are present in a single object within the decoded JWT.

KeyValueRequiredDescription
locationstringtruePath to lookup the Hasura claims within the decoded claims.
claimsFormatJson / StringifiedJsontrueFormat in which the Hasura claims will be present.

JWTKey

Information of the JWT key to verify the token.

One of the following values:

ValueDescription
JWTFixedKeyConfigConfigurations for an inline JWT key secret
JWTRemoteKeyConfigConfigurations for a remote URL where publishes JSON Web Keys

JWTRemoteKeyConfig

Configurations for a remote URL where publishes JSON Web Keys

KeyValueRequiredDescription
algorithmES256 / ES384 / ES512 / EdDSA / HS256 / HS384 / HS512 / PS256 / PS384 / PS512 / RS256 / RS384 / RS512falseAlgorithm to be used for verifying the signature
jwkFromUrlEnvStringtrueA URL where a provider publishes their JWKs (JSON Web Keys - which are used for signing the JWTs). The URL must publish the JWKs in the standard format as described in the RFC 7517 specification.

JWTFixedKeyConfig

Configurations for an inline JWT key secret

KeyValueRequiredDescription
algorithmES256 / ES384 / ES512 / EdDSA / HS256 / HS384 / HS512 / PS256 / PS384 / PS512 / RS256 / RS384 / RS512trueAlgorithm to be used for verifying the signature
keyEnvStringtrueInline value of the key to use for decoding the JWT

RelyAuthAPIKeyConfig

RelyAuthAPIKeyConfig contains configurations for HTTP authentication with static secrets.

KeyValueRequiredDescription
idstringfalseUnique identity of the auth config. If not set, ID will be the index of the array.
modeapiKeytrueAuthentication mode which is always apiKey.
descriptionstringfalseBrief description of the auth config.
tokenLocationTokenLocationtrueSource of the authentication token.
sessionVariablesmap[string]EnvAnytrueCustom session variables for this auth mode.
valueEnvStringtrueValue of the static API key to be compared.
securityRulesRelyAuthSecurityRulesConfigfalseConfigurations for extra security rules

RelyAuthSecurityRulesConfig

RelyAuthSecurityRulesConfig defines configurations of security rules.

KeyValueRequiredDescription
allowedIPsRelyAuthIPAllowListConfigfalseConfigure the list of allowed IPs.
headerRulesmap[string]RelyAuthAllowListConfigfalseConfigure the map of header rules.

RelyAuthAllowListConfig

RelyAuthAllowListConfig represents a common setting for allow list.

KeyValueRequiredDescription
includeEnvStringSlicefalseList of allowed patterns.
excludeEnvStringSlicefalseList of disallowed patterns.

RelyAuthIPAllowListConfig

RelyAuthIPAllowListConfig represents a setting for IP allow list.

KeyValueRequiredDescription
includeEnvStringSlicefalseList of allowed patterns.
excludeEnvStringSlicefalseList of disallowed patterns.
headers[string]falseThe client IP could be in this header list. Use default client IP headers if empty.

EnvStringSlice

List of allowed patterns.

KeyValueRequiredDescription
value[string]falseDefault literal value if the env is empty
envstringfalseEnvironment variable to be evaluated

EnvString

Value of the static API key to be compared.

KeyValueRequiredDescription
valuestringfalseDefault literal value if the env is empty
envstringfalseEnvironment variable to be evaluated

EnvAny

KeyValueRequiredDescription
valuefalseDefault literal value if the env is empty
envstringfalseEnvironment variable to be evaluated

TokenLocation

TokenLocation contains the configuration for the location of the access token.

KeyValueRequiredDescription
inheader / query / cookietrueThe location enum for setting authentication value
namestringtrueName of the field to validate, for example, Authorization header.
schemestringfalseThe name of the HTTP Authentication scheme to be used in the Authorization header as defined in RFC7235. The values used SHOULD be registered in the IANA Authentication Scheme registry. https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml The value is case-insensitive, as defined in RFC7235.

RelyAuthSettings

RelyAuthSettings holds global settings for the authenticators.

KeyValueRequiredDescription
reloadIntervalintegerfalseThe interval in seconds to reload JSON web keys from the remote URL. If the value is zero or negative, disables the process.