Conversation
|
Sample output with Sample output with |
- When read-only mode is enabled via rails config, controller endpoints that are explicitly enrolled into a `write_protected` list return a HTTP 405 Method Not Allowed when invoked, also throwing Conjur error code: `CONJ00153E` - Implemented using module prepending
| @@ -0,0 +1,15 @@ | |||
| module ReadOnlyPrepender | |||
There was a problem hiding this comment.
ReadOnlyPrepender has no descriptive comment
| def write_protected(*method_names) | ||
| method_names.each do |m| | ||
| proxy = Module.new do | ||
| define_method(m) do |*args| |
There was a problem hiding this comment.
ReadOnlyPrepender#write_protected contains iterators nested 2 deep
| method_names.each do |m| | ||
| proxy = Module.new do | ||
| define_method(m) do |*args| | ||
| raise ::Errors::Conjur::ReadOnly::ActionNotPermitted unless !Rails.configuration.read_only |
There was a problem hiding this comment.
Add empty line after guard clause.
| self.prepend proxy | ||
| end | ||
| end | ||
| end |
There was a problem hiding this comment.
end at 15, 2 is not aligned with module ReadOnlyPrepender at 1, 0.
| module ReadOnlyPrepender | ||
| # Given a list of method symbols, preempt calls to them using a proxy that | ||
| # raises an error if read_only is enabled. | ||
| def write_protected(*method_names) |
There was a problem hiding this comment.
Use 2 (not 4) spaces for indentation.
|
Code Climate has analyzed commit 380bb0a and detected 9 issues on this pull request. Here's the issue category breakdown:
The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 87.4% (-0.7% change). View more on Code Climate. |
|
Is this still relevant? |
6566647 to
d65d499
Compare
d65d499 to
dbea020
Compare
dbea020 to
8031a2a
Compare
read_safelist return a HTTP 405 Method Not Allowed when invoked, also throwing Conjur error code:CONJ00153EDesired Outcome
Please describe the desired outcome for this PR. Said another way, what was
the original request that resulted in these code changes? Feel free to copy
this information from the connected issue.
Implemented Changes
Describe how the desired outcome above has been achieved with this PR. In
particular, consider:
Connected Issue/Story
Resolves #[relevant GitHub issue(s), e.g. 76]
CyberArk internal issue ID: [insert issue ID]
Definition of Done
At least 1 todo must be completed in the sections below for the PR to be
merged.
Changelog
CHANGELOG update
Test coverage
changes, or
Documentation
READMEs) were updated in this PRBehavior
Security