Module: Linzer::Signature::Profile

Defined in:
lib/linzer/signature/profile.rb,
lib/linzer/signature/profile/base.rb,
lib/linzer/signature/profile/example.rb,
lib/linzer/signature/profile/web_bot_auth.rb

Overview

A signing profile defines optional behavior that can modify a signing context prior to HTTP Message Signature generation.

Profiles are used to encapsulate domain-specific signing rules such as:

  • default covered components

  • parameter enrichment

  • contextual header injection

  • policy-based adjustments to signing behavior

Profiles are applied *before signature computation* and may mutate Context.

Defined Under Namespace

Classes: Base, Example, WebBotAuth

Class Method Summary collapse

Class Method Details

.resolve(profile) ⇒ Profile::Base?

Resolves a signing profile from a symbolic or object-based reference.

This allows callers to pass either:

  • nil (no profile)

  • an already constructed profile instance

  • a symbolic identifier for a registered profile

Parameters:

  • profile (Symbol, Profile::Base, nil)

    The profile identifier or instance to resolve

Returns:

  • (Profile::Base, nil)

    A resolved profile instance, or nil if no profile is used

Raises:

  • (Linzer::Error)

    If the profile symbol is unknown or unsupported



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/linzer/signature/profile.rb', line 37

def self.resolve(profile)
  unsupported = "Unknown/unsupported signing profile!"

  case profile
  when NilClass, Profile::Base
    profile
  when Symbol
    case profile
    when :web_bot_auth
      WebBotAuth.default
    else
      raise Error, unsupported
    end
  else
    raise Error, unsupported
  end
end

.web_bot_auth(**options) ⇒ Profile::WebBotAuth

Convenience constructor for a Web Bot Auth signing profile.

This is a helper for constructing a profile instance directly without using resolve.

Parameters:

  • options (Hash)

    Options passed through to WebBotAuth initializer

Returns:



65
66
67
# File 'lib/linzer/signature/profile.rb', line 65

def self.web_bot_auth(**options)
  WebBotAuth.new(**options)
end