-
Notifications
You must be signed in to change notification settings - Fork 76
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
Basic Groups support #48
Conversation
# like [:names, 0, :givenName]. `.dig` can then use that path | ||
# against the params to translate the :name attribute to "John". | ||
|
||
def path_for(attribute, object = controller_schema, path = []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/CyclomaticComplexity: Cyclomatic complexity for path_for is too high. [7/6]
Metrics/MethodLength: Method has too many lines. [16/10]
groups = @company | ||
.public_send(ScimRails.config.scim_groups_scope) | ||
.where( | ||
"#{ScimRails.config.scim_groups_model.connection.quote_column_name(query.attribute)} #{query.operator} ?", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [118/80]
@@ -0,0 +1,66 @@ | |||
module ScimRails | |||
class ScimGroupsController < ScimRails::ApplicationController |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/Documentation: Missing top-level class documentation comment.
@@ -0,0 +1,79 @@ | |||
module ScimRails | |||
class ScimGroupsController < ScimRails::ApplicationController | |||
def index |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/AbcSize: Assignment Branch Condition size for index is too high. [36.24/15]
Metrics/MethodLength: Method has too many lines. [23/10]
@@ -61,20 +69,24 @@ def user_response(user) | |||
# send those symbols to the model, and replace the symbol with | |||
# the return value. | |||
|
|||
def find_value(user, object) | |||
case object | |||
def find_value(object, schema) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/AbcSize: Assignment Branch Condition size for find_value is too high. [17.75/15]
Metrics/MethodLength: Method has too many lines. [18/10]
@@ -0,0 +1,10 @@ | |||
class CreateGroups < ActiveRecord::Migration[5.0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true.
@@ -0,0 +1,10 @@ | |||
class CreateGroupUsers < ActiveRecord::Migration[5.0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true.
# | ||
# It's strongly recommended that you check this file into your version control system. | ||
|
||
ActiveRecord::Schema.define(version: 20181206184313) do | ||
ActiveRecord::Schema.define(version: 2021_04_23_075950) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/NumericLiterals: Use underscores(_) as decimal mark and separate every 3 digits with them.
# from scratch. The latter is a flawed and unsustainable approach (the more migrations | ||
# you'll amass, the slower it'll run and the greater likelihood for issues). | ||
# This file is the source Rails uses to define your schema when running `bin/rails | ||
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [84/80]
# system, you should be using db:schema:load, not running all the migrations | ||
# from scratch. The latter is a flawed and unsustainable approach (the more migrations | ||
# you'll amass, the slower it'll run and the greater likelihood for issues). | ||
# This file is the source Rails uses to define your schema when running `bin/rails |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [82/80]
@@ -0,0 +1,11 @@ | |||
FactoryBot.define do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true.
@valerauko thanks for this PR! It looks like a lot of good stuff at first glance. We'll try to get to it some time this week |
@valerauko sorry for the delay. Things have got a little busy and this is something we really want to put proper attention on |
No worries, take your time |
Why?
Support for SCIM user Groups is currently missing
Closes #46
What?
Caveats
members
is a bit hacky.Testing Notes
I'm developing this using Okta as well so there shouldn't be anything extra to set up.
Todo
I'm planning to mark this "ready for review" once I add rspec tests and fix lint violations
Alternatives Considered
There is the option to build a more complete User association handling as outlined in #39, but I felt that's a bit too big to chew for this purpose.