Module: Legate::Auth::Schemes

Defined in:
lib/legate/auth/schemes.rb,
lib/legate/auth/schemes/oauth2.rb,
lib/legate/auth/schemes/api_key.rb,
lib/legate/auth/schemes/http_bearer.rb,
lib/legate/auth/schemes/openid_connect.rb,
lib/legate/auth/schemes/service_account.rb,
lib/legate/auth/schemes/google_service_account.rb

Overview

Namespace module for authentication schemes

Defined Under Namespace

Classes: ApiKey, GoogleServiceAccount, HTTPBearer, OAuth2, OpenIDConnect, ServiceAccount

Constant Summary collapse

HttpBearer =

Alias HTTPBearer as HttpBearer for backward compatibility

HTTPBearer
OIDC =

Alias for backward compatibility

OpenIDConnect

Class Method Summary collapse

Class Method Details

.create(type, **options) ⇒ Legate::Auth::Scheme

Create a scheme instance based on type

Parameters:

  • type (Symbol)

    The scheme type

  • options (Hash)

    Options for the scheme

Returns:

Raises:



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/legate/auth/schemes.rb', line 20

def self.create(type, **options)
  case type.to_sym
  when :api_key
    ApiKey.new(**options)
  when :http_bearer
    HTTPBearer.new(**options)
  when :oauth2
    OAuth2.new(**options)
  when :oidc, :openid_connect
    OpenIDConnect.new(**options)
  when :service_account
    ServiceAccount.new(**options)
  when :google_service_account
    GoogleServiceAccount.new(**options)
  else
    raise Legate::Auth::ConfigurationError, "Unknown scheme type: #{type}"
  end
end