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

Move consent #22

Merged
merged 83 commits into from
Aug 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
f96f0f8
Initial extraction of Nitro::Consent
xjunior Sep 27, 2016
0c1527b
Fix railtie
xjunior Sep 27, 2016
2f0c832
Make actions an array instead of a hash
xjunior Sep 27, 2016
8b34dbe
Add Permission
xjunior Sep 27, 2016
5f3d24b
Add support for default view
xjunior Sep 27, 2016
8e5aa98
Unexisting view means no permission
xjunior Sep 27, 2016
313e442
Add support for object conditions
xjunior Sep 27, 2016
05227b2
Extract Consent::Permissions
xjunior Sep 27, 2016
cdf8ca0
Update Consent rspec matchers
xjunior Sep 27, 2016
7ba48bb
Add documentation
xjunior Sep 28, 2016
6c4b5ae
Documentation update
Sep 29, 2016
0da48ae
Allow multiple permission directories
xjunior Oct 31, 2016
51bd703
Add consent:permissins rails generator
xjunior Nov 1, 2016
c9374c2
Bump version
xjunior Nov 1, 2016
249da32
Remove Nitro module/namespace
xjunior Nov 3, 2016
9ff37dc
Rename gem from nitro-consent to consent
xjunior Nov 3, 2016
d4cc12d
Bump version
xjunior Nov 4, 2016
b5f7ede
Remove private repository restriction
xjunior Nov 4, 2016
d9d6cc8
Add Travis badge
xjunior Nov 7, 2016
1a9773d
Setup rubygems deployment
xjunior Nov 8, 2016
fedd360
Bump version
xjunior Nov 8, 2016
a6ca436
Creates a generator for spec
trecenti Jan 18, 2017
30c1952
Make subjects an array instead of a hash
xjunior Mar 26, 2019
1a2ba1d
Move methods from Rspec to consent API
xjunior Mar 27, 2019
d6e9a09
Bump to 0.4
xjunior Mar 27, 2019
b26090f
Bump activesupport version – clear security alert
xjunior Mar 28, 2019
463c8a4
Bump version 0.4.2
xjunior Mar 28, 2019
2a7b348
Prevent permissions from being loaded twice
xjunior Apr 1, 2019
a87c4fe
Bump version 0.4.3
xjunior Apr 2, 2019
183a4ef
Fix flaky spec on symbol permissions
xjunior Apr 2, 2019
b87829e
Update bundler version to satisfy CI scenario
xjunior Nov 20, 2019
9d8bda8
Load permissions via load instead of require
xjunior Nov 21, 2019
ab292b6
Introduce Consent::Reloader to reload permissions in rails
xjunior Nov 21, 2019
b2dfb0f
Move consent preloading to after_initialize to avoid permissions load…
xjunior Nov 23, 2019
aac633d
Rubocop compliant code
xjunior Nov 20, 2019
734dd57
Add basic YARD docs
xjunior Nov 20, 2019
c549a0a
Configure travis to run rubocop on test
xjunior Nov 25, 2019
32f3e74
Bump consent to v0.5.0
xjunior Nov 25, 2019
a43c290
Only deploy on ruby 2.5.0
xjunior Nov 26, 2019
0462577
Always reload on prepare
xjunior Nov 27, 2019
dcd955c
Release v0.5.1
xjunior Nov 27, 2019
36236b0
Bump version 0.5.2
xjunior Nov 28, 2019
f2e8189
License metadata
benlangfeld Dec 22, 2020
3c7051a
Whitespace
benlangfeld Dec 22, 2020
03ffc05
Release 0.6.0
xjunior Dec 22, 2020
58362ed
Introduce ability#consent to consent specific permission to ability
xjunior Apr 13, 2020
4cbd13c
Build Consent::Permission with keys
xjunior Apr 13, 2020
0b17846
Do not consent invalid permission
xjunior Apr 6, 2021
8349230
Only apply default permissions on initialization
xjunior Apr 6, 2021
b09bbae
Remove permissions mapping
xjunior Apr 6, 2021
39fce11
Remove unused subject#view_for
xjunior Apr 6, 2021
0b8eb91
Remove unused dependency on activesupport
xjunior Apr 6, 2021
cad276d
Update supported rubies
xjunior Apr 6, 2021
ccdf36f
Update documentation
xjunior Apr 6, 2021
599cc47
Update README.md
wadewinningham Apr 22, 2021
306b0bd
Release 1.0.0
xjunior Apr 22, 2021
6682a4e
Update rake
xjunior Apr 22, 2021
6a83646
Add pry for development
xjunior Apr 28, 2021
bd417c7
Simplify find_subjects
xjunior Apr 28, 2021
af03236
Add subject reference to action
xjunior Apr 28, 2021
538309d
Find view definition within action context
xjunior Apr 28, 2021
4ad7022
Remove unused permission class
xjunior Apr 28, 2021
797ccdf
Remove nitro directory
xjunior Apr 28, 2021
68353e9
Fix rspec module
xjunior Apr 28, 2021
65d1328
Fix rubocop violations
xjunior Apr 28, 2021
bb790ec
Extract Consent::Rspec::ConsentAction and ConsentView matchers
xjunior Apr 30, 2021
47a75e4
Add activerecord to consent test environment
xjunior Apr 30, 2021
99d526f
Turn SomeModel into an activerecord
xjunior Apr 30, 2021
8fc2c61
Add support for testing scope conditions
xjunior Apr 30, 2021
073c700
Improve messages for consent action and consent view matchers
xjunior May 6, 2021
1522df5
Release v1.0.1
xjunior May 10, 2021
679c5b5
Moved consent to packages
xjunior Aug 22, 2022
0dc6cf9
Switch consent to github workflows
xjunior Aug 22, 2022
43cf401
Add license_finder to consent
xjunior Aug 22, 2022
82ba497
Run consent specs against multiple rails versions
xjunior Aug 22, 2022
a8fcdd5
Add power's dependency decisions
xjunior Aug 22, 2022
5e4e286
Ignore stuff
xjunior Aug 22, 2022
e0aa229
Bump rake, bundler and rubocop
xjunior Aug 22, 2022
cfb6966
rubocop-powerhome autofixes
xjunior Aug 22, 2022
1b35a8c
Add rubocop to CI
xjunior Aug 22, 2022
c8826bf
Fix Consent's portal config
xjunior Aug 22, 2022
935400f
Remove duplicated license files
xjunior Aug 22, 2022
35dabd5
Add consent to README.md
xjunior Aug 22, 2022
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
13 changes: 13 additions & 0 deletions .github/workflows/consent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: consent

on:
push:

jobs:
ruby:
uses: ./.github/workflows/_ruby-package.yml
with:
package: ${{ github.workflow }}
ruby: '["2.7.4", "3.1.2"]'
rails: '["7.0.3.1","6.1.6.1","6.0.5.1","5.2.8.1"]'
secrets: inherit
5 changes: 5 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ AuditTracker helps you centralize data tracking configuration to be used across

Lumberaxe handles logging output formatting.

[consent](https://github.com/powerhome/power-tools/blob/main/packages/consent/docs/README.md) 💎

Consent provides permission-based authorization.

## Installation 🛠

These packages are all meant to install inside of an application and aren't intended to stand alone; currently, they are all published to [RubyGems](https://rubygems.org/) and you can use standard Bundler methods to install them.
Expand Down Expand Up @@ -63,3 +67,4 @@ These packages are maintained by [Power's](https://github.com/powerhome) Heroes
## Contributing 💙

Contributions are welcome! Feel free to [open a ticket](https://github.com/powerhome/power-tools/issues/new) or a [PR](https://github.com/powerhome/power-tools/pulls).

1 change: 0 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
site_name: Power Tools
site_description: Packages for application configuration.
repo_url: https://github.com/powerhome/power-tools
edit_uri: edit/main/nitro_config/docs/
nav:
- 'Home': 'README.md'
plugins:
Expand Down
21 changes: 0 additions & 21 deletions packages/audit_tracker/LICENSE.txt

This file was deleted.

18 changes: 18 additions & 0 deletions packages/consent/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/.bundle/
/.yardoc
/_yardoc/
coverage
pkg
/spec/reports/
**/tmp/*
!**/tmp/.gitkeep
!tmp/.gitignore
vendor/bundle
*.log
*.sqlite
*.sqlite3
Gemfile.lock

# Ignore uploaded files in development
/storage/*
!/storage/.keep
10 changes: 10 additions & 0 deletions packages/consent/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
inherit_from: .rubocop_todo.yml

require:
- rubocop-powerhome

AllCops:
TargetRubyVersion: 2.7

Rails:
Enabled: false
13 changes: 13 additions & 0 deletions packages/consent/.rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2022-08-22 19:25:27 UTC using RuboCop version 1.35.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 3
# Configuration parameters: AllowComments, AllowEmptyLambdas.
Lint/EmptyBlock:
Exclude:
- 'spec/consent_spec.rb'
10 changes: 10 additions & 0 deletions packages/consent/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

source "https://rubygems.org"

# Specify your gem's dependencies in consent.gemspec
gemspec

rails_version = ENV.fetch("RAILS_VERSION", ">= 5")

gem "rails", rails_version
14 changes: 14 additions & 0 deletions packages/consent/Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env rake

# frozen_string_literal: true

require "bundler/setup"
Bundler::GemHelper.install_tasks

require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec)

require "rubocop/rake_task"
RuboCop::RakeTask.new(:rubocop)

task default: %i[spec rubocop]
15 changes: 15 additions & 0 deletions packages/consent/bin/console
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require 'bundler/setup'
require 'consent'

# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.

# (If you use this, don't forget to add pry to your Gemfile!)
# require "pry"
# Pry.start

require 'irb'
IRB.start
8 changes: 8 additions & 0 deletions packages/consent/bin/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
set -vx

bundle install

# Do any other automated setup that you need to do here
32 changes: 32 additions & 0 deletions packages/consent/consent.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# frozen_string_literal: true

lib = File.expand_path("lib", __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "consent/version"

Gem::Specification.new do |spec|
spec.name = "consent"
spec.version = Consent::VERSION
spec.authors = ["Carlos Palhares"]
spec.email = ["chjunior@gmail.com"]

spec.summary = "Consent permission based authorization"
spec.description = "Consent permission based authorization"
spec.homepage = "https://github.com/powerhome/power-tools"
spec.license = "MIT"
spec.required_ruby_version = ">= 2.7"

spec.files = `git ls-files`.split.grep_v(/^(test|spec|features)/)
spec.require_paths = ["lib"]

spec.add_development_dependency "activerecord", ">= 5"
spec.add_development_dependency "bundler", "~> 2.1"
spec.add_development_dependency "cancancan", "~> 1.15.0"
spec.add_development_dependency "license_finder", ">= 7.0"
spec.add_development_dependency "pry-byebug", "3.9.0"
spec.add_development_dependency "rake", "~> 13"
spec.add_development_dependency "rspec", "~> 3.0"
spec.add_development_dependency "rubocop-powerhome", "0.5.0"
spec.add_development_dependency "sqlite3", "~> 1.4.2"
spec.metadata["rubygems_mfa_required"] = "true"
end
3 changes: 3 additions & 0 deletions packages/consent/doc/dependency_decisions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
- - :inherit_from
- https://raw.githubusercontent.com/powerhome/oss-guide/master/license_rules.yml
Loading