-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial extraction of Nitro::Consent * Fix railtie * Make actions an array instead of a hash * Add Permission * Add support for default view * Unexisting view means no permission * Add support for object conditions * Extract Consent::Permissions * Update Consent rspec matchers * Add documentation * Documentation update * Allow multiple permission directories This allow engines to declare their own permissions * Add consent:permissins rails generator * Bump version * Remove Nitro module/namespace * Rename gem from nitro-consent to consent * Bump version * Remove private repository restriction * Add Travis badge * Setup rubygems deployment * Bump version * Creates a generator for spec * Make subjects an array instead of a hash Adds ruby 2.5.0 to travis test * Move methods from Rspec to consent API * Bump to 0.4 * Bump activesupport version – clear security alert * Bump version 0.4.2 * Prevent permissions from being loaded twice * Bump version 0.4.3 * Fix flaky spec on symbol permissions * Update bundler version to satisfy CI scenario * Load permissions via load instead of require * Introduce Consent::Reloader to reload permissions in rails * Move consent preloading to after_initialize to avoid permissions loaded twice in production * Rubocop compliant code * Add basic YARD docs * Configure travis to run rubocop on test * Bump consent to v0.5.0 * Only deploy on ruby 2.5.0 * Always reload on prepare Reloading only when permisions file change breaks the reference of the subject in consent. Consider the following scenario: 1. Rails is loaded, permissions to User also are loaded 2. Any file in app changes, User model is reloaded 3. Consent has a reference to the old User definition, with a different object_id * Release v0.5.1 * Bump version 0.5.2 * License as MIT See https://tech.powerhrg.com/oss-guide/docs/publishing/publish.html * License metadata * Whitespace * Release 0.6.0 * Introduce ability#consent to consent specific permission to ability * Build Consent::Permission with keys * Do not consent invalid permission * Only apply default permissions on initialization * Remove permissions mapping * Remove unused subject#view_for * Remove unused dependency on activesupport * Update supported rubies * Update documentation * Add renovate.json * Update README.md * Release 1.0.0 * Update rake * Add pry for development * Simplify find_subjects * Add subject reference to action * Find view definition within action context * Remove unused permission class * Remove nitro directory * Fix rspec module * Fix rubocop violations * Extract Consent::Rspec::ConsentAction and ConsentView matchers * Add activerecord to consent test environment * Turn SomeModel into an activerecord * Add support for testing scope conditions * Improve messages for consent action and consent view matchers * Release v1.0.1 * Adding initial portal configs * Fixed heroes typo * Moved consent to packages * Switch consent to github workflows * Add license_finder to consent * Run consent specs against multiple rails versions * Add power's dependency decisions * Ignore stuff * Bump rake, bundler and rubocop * rubocop-powerhome autofixes * Add rubocop to CI * Add consent to power-tools README * Fix Consent's portal config * Remove duplicated license files * Update docs/README.md Co-authored-by: Jill Klang <[email protected]> Co-authored-by: Jillian Tankersley <[email protected]> Co-authored-by: Bruno Trecenti <[email protected]> Co-authored-by: Ben Langfeld <[email protected]> Co-authored-by: Renovate Bot <[email protected]> Co-authored-by: Wade Winningham <[email protected]> Co-authored-by: Dang Huynh <[email protected]> Co-authored-by: Jill Klang <[email protected]>
- Loading branch information
1 parent
bde4d45
commit e641c5a
Showing
45 changed files
with
1,359 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = ["[email protected]"] | ||
|
||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.