Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails::Auth::Monitor::Middleware #33

Merged
merged 1 commit into from Jul 17, 2016
Merged

Conversation

tarcieri
Copy link
Contributor

Adds a middleware which fires a callback for every request which includes the Rack environment and whether or not the request was authorized.

Useful for logging AuthZ status of each request and/or reporting AuthZ failures to e.g. an alerting system.

@tarcieri
Copy link
Contributor Author

@tarcieri tarcieri force-pushed the tarcieri/monitor-middleware branch from 5c88299 to cbff918 Compare July 17, 2016 00:23
Adds a middleware which fires a callback for every request which
includes the Rack environment and whether or not the request was
authorized.

Useful for logging AuthZ status of each request and/or reporting
AuthZ failures to e.g. an alerting system.
@tarcieri tarcieri force-pushed the tarcieri/monitor-middleware branch from cbff918 to 87dfed9 Compare July 17, 2016 00:23
raise
end

@callback.call(env, true)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be neat to actually pass the matcher used to authorize the request here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ended up leaving this as-is, but doing a separate PR that allows us to retrieve which matcher authorized the request: #34

@tarcieri tarcieri merged commit ce734a7 into master Jul 17, 2016
@tarcieri tarcieri deleted the tarcieri/monitor-middleware branch July 17, 2016 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant