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

Bearer integration #269

Merged
merged 5 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Automated Code Reviews
on: [pull_request]

permissions:
contents: read
pull-requests: write

jobs:
bearer:
name: Bearer Security Analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest
- name: Bearer
uses: bearer/bearer-action@v2
with:
diff: true
format: rdjson
derricklannaman marked this conversation as resolved.
Show resolved Hide resolved
output: rd.json
- name: Run reviewdog
if: always()
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
touch rd.json && cat rd.json | reviewdog -f=rdjson -reporter=github-pr-check
2 changes: 2 additions & 0 deletions packages/consent/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## [Unreleased]

- removed eval_view as a legacy, unsafe concern

## [2.0.1] - 2023-01-08

- Bugfixes, minor version bumps
Expand Down
8 changes: 0 additions & 8 deletions packages/consent/lib/consent/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ def with_defaults(new_defaults, &block)
DSL.build(@subject, @defaults.merge(new_defaults), &block)
end

# rubocop:disable Lint/UnusedBlockArgument, Security/Eval
def eval_view(key, label, collection_conditions)
view key, label do |user|
eval(collection_conditions)
end
end
# rubocop:enable Lint/UnusedBlockArgument, Security/Eval

def view(key, label, instance = nil, collection = nil, &block)
collection ||= block
@subject.views[key] = View.new(key, label, instance, collection)
Expand Down
16 changes: 0 additions & 16 deletions packages/consent/spec/consent/dsl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,6 @@
end
end

describe "#eval_view" do
it "accepts a conditions string for eval" do
dsl.eval_view :view_key, "View YEY", "{object: 1}"

expect(subject.views[:view_key].conditions(nil)).to eql(object: 1)
end

it "is a view that evaluate the condition as ruby with the user variable" do
user = double(id: 1)

dsl.eval_view :view_key, "View YEY", "{user: user.id}"

expect(subject.views[:view_key].conditions(user)).to eql(user: 1)
end
end

describe "#action" do
let(:view_all) { double }
let(:view_no_access) { double }
Expand Down
Loading