Module: Fluence::Gateway::Auth

Defined in:
lib/fluence/gateway/auth.rb,
lib/fluence/gateway/auth/errors.rb,
lib/fluence/gateway/auth/railtie.rb,
lib/fluence/gateway/auth/version.rb,
lib/fluence/gateway/auth/middleware.rb,
lib/fluence/gateway/auth/test_helpers.rb,
lib/fluence/gateway/auth/configuration.rb,
lib/fluence/gateway/auth/gateway_connection.rb,
lib/fluence/gateway/auth/gateway_authentication.rb

Overview

Top-level namespace of the fluence-gateway-auth gem.

The gem plugs a Rails (or plain Rack) application into the Fluence API Gateway. It ships three moving parts:

  • Middleware — Rack middleware that verifies the HMAC signature injected by the gateway on every request.
  • GatewayAuthentication — controller concern that exposes current_<scope>, <scope>_signed_in? and authenticate_<scope>! helpers, resolving the current user from the gateway headers.
  • GatewayConnection — ActionCable connection concern that resolves current_user from the WebSocket upgrade headers.

In a Rails application, Railtie wires everything automatically — outside Rails, include the pieces you need manually.

Examples:

Configure the gem

Fluence::Gateway::Auth.configure do |config|
  config.user_model  = 'User'
  config.hmac_secret = ENV.fetch('GATEWAY_HMAC_SECRET')
end

Read the current configuration

Fluence::Gateway::Auth.configuration.user_model # => "User"

Defined Under Namespace

Modules: GatewayAuthentication, GatewayConnection, TestHelpers Classes: Configuration, ConfigurationError, Error, InvalidOnMissingUser, InvalidScopeName, InvalidSubjectColumn, InvalidUserModel, Middleware, MissingHmacSecret

Constant Summary collapse

VERSION =

Current gem version. Bumped by the release workflow — do not edit by hand outside of a release commit.

'0.10.1'

Class Method Summary collapse

Class Method Details

.configurationConfiguration

Memoised configuration singleton. Created lazily on first access.

Returns:

.configure {|config| ... } ⇒ Configuration

Yields the Configuration instance for block-style setup. Typically called once from config/initializers/fluence_gateway_auth.rb.

Yield Parameters:

Yield Returns:

  • (void)

Returns: