Skip to content

ConfigBuilder.application helper function not working #49

@hablutzel1

Description

@hablutzel1

Following configuration method is not working, https://github.com/square/rails-auth/wiki/Rails-Usage#user-content-configapplicationrb.

It seems to me that the reason is a wrong variable name around https://github.com/square/rails-auth/blob/master/lib/rails/auth/config_builder.rb#L9:

def application(config, acl_file: Rails.root.join("config/acl.yml"), matchers: {})
        config.x.rails_auth.acl = Rails::Auth::ACL.from_yaml(
          File.read(acl_file.to_s),
          matchers: matchers
        )
        config.middleware.use Rails::Auth::ACL::Middleware, acl: config.x.acl
end

Where I think that config.x.rails_auth.acl = Rails::Auth::ACL.from_yaml(... should be config.x.acl = Rails::Auth::ACL.from_yaml(... (without the rails_auth) as later you are doing config.middleware.use Rails::Auth::ACL::Middleware, acl: config.x.acl.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions