Skip to content

task: make the handler field support only snake_case #53

Closed
@GrantBirki

Description

@GrantBirki

This issue tracks work to make the handler: <value> field of the endpoint(s) configuration files support only snake_case to match the same enforcements of the auth.type field. So instead of handler: Team1Handler it should just be handler: team_1_handler.

Another more in-depth example:

If a file is called handlers/github_handler.rb and its contents are:

# frozen_string_literal: true

# Example handler for GitHub webhooks
class GithubHandler < Hooks::Plugins::Handlers::Base
  # Process GitHub webhook
  #
  # @param payload [Hash, String] GitHub webhook payload
  # @param headers [Hash<String, String>] HTTP headers
  # @param config [Hash] Endpoint configuration
  # @return [Hash] Response data
  def call(payload:, headers:, env:, config:)
    log.info("🚀 Processing GitHub webhook 🚀")
    return {
      status: "success"
    }
  end
end

It should be referenced via handler: github_handler in the endpoint config. This is a breaking change and it should not be made backwards compatible. Moving forward, no more pascal case. Ruby Classes are pascal case but we will be referencing them via snake_case in the config files.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions