Class: A2A::Plugin::AuthPlugin

Inherits:
Base
  • Object
show all
Defined in:
lib/a2a/plugin.rb

Overview

Authentication plugin interface

Direct Known Subclasses

A2A::Plugins::ExampleAuth

Instance Attribute Summary

Attributes inherited from Base

#config, #logger

Instance Method Summary collapse

Methods inherited from Base

#cleanup, dependencies, depends_on, inherited, #initialize, plugin_type, #register_hooks

Constructor Details

This class inherits a constructor from A2A::Plugin::Base

Instance Method Details

#authenticate_request(request, **options) ⇒ Hash

Authenticate a request (must be implemented by subclasses)

Parameters:

  • Request data

  • Authentication options

Returns:

  • Authenticated request

Raises:



292
293
294
# File 'lib/a2a/plugin.rb', line 292

def authenticate_request(request, **options)
  raise NotImplementedError, "Auth plugins must implement #authenticate_request"
end

#validate_credentials(_credentials) ⇒ Boolean

Validate authentication (optional)

Parameters:

  • Credentials to validate

Returns:

  • Whether credentials are valid



299
300
301
# File 'lib/a2a/plugin.rb', line 299

def validate_credentials(_credentials)
  true
end