Skip to content

Commit f0800ef

Browse files
committed
Initial commit
0 parents  commit f0800ef

File tree

84 files changed

+2778
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+2778
-0
lines changed

.gitignore

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
*.gem
2+
tags
3+
_site
4+
.sass-cache
5+
.DS_Store
6+
.byebug_history
7+
8+
coverage/
9+
doc/
10+
11+
**/log/*
12+
**/tmp/*
13+
!**/log/.keep
14+
!**/tmp/.keep
15+
16+
/.bundle
17+
/vendor/bundle

.ruby-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.7.2

.tm_properties

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
excludeDirectories = "{$excludeDirectories,docs/rdoc,coverage,log}"

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 1.0.0 (2020-02-23)
2+
3+
* Initial RIP private release.

Gemfile

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
source "https://rubygems.org"
2+
3+
# Use a fork version of SDoc; can't use ":git" in ".gemspec" files, so do
4+
# it here instead.
5+
#
6+
gem 'sdoc', :git => 'https://github.com/pond/sdoc.git', :branch => 'master'
7+
8+
gemspec

Gemfile.lock

+195
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
GIT
2+
remote: https://github.com/pond/sdoc.git
3+
revision: e1e35566f9f207bffb3511fea4779629de94d029
4+
branch: master
5+
specs:
6+
sdoc (1.0.1)
7+
json
8+
rdoc (>= 5.0)
9+
10+
PATH
11+
remote: .
12+
specs:
13+
scimitar (1.0.0)
14+
nokogiri (~> 1.11)
15+
rails (>= 6.0)
16+
17+
GEM
18+
remote: https://rubygems.org/
19+
specs:
20+
actioncable (6.1.3)
21+
actionpack (= 6.1.3)
22+
activesupport (= 6.1.3)
23+
nio4r (~> 2.0)
24+
websocket-driver (>= 0.6.1)
25+
actionmailbox (6.1.3)
26+
actionpack (= 6.1.3)
27+
activejob (= 6.1.3)
28+
activerecord (= 6.1.3)
29+
activestorage (= 6.1.3)
30+
activesupport (= 6.1.3)
31+
mail (>= 2.7.1)
32+
actionmailer (6.1.3)
33+
actionpack (= 6.1.3)
34+
actionview (= 6.1.3)
35+
activejob (= 6.1.3)
36+
activesupport (= 6.1.3)
37+
mail (~> 2.5, >= 2.5.4)
38+
rails-dom-testing (~> 2.0)
39+
actionpack (6.1.3)
40+
actionview (= 6.1.3)
41+
activesupport (= 6.1.3)
42+
rack (~> 2.0, >= 2.0.9)
43+
rack-test (>= 0.6.3)
44+
rails-dom-testing (~> 2.0)
45+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
46+
actiontext (6.1.3)
47+
actionpack (= 6.1.3)
48+
activerecord (= 6.1.3)
49+
activestorage (= 6.1.3)
50+
activesupport (= 6.1.3)
51+
nokogiri (>= 1.8.5)
52+
actionview (6.1.3)
53+
activesupport (= 6.1.3)
54+
builder (~> 3.1)
55+
erubi (~> 1.4)
56+
rails-dom-testing (~> 2.0)
57+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
58+
activejob (6.1.3)
59+
activesupport (= 6.1.3)
60+
globalid (>= 0.3.6)
61+
activemodel (6.1.3)
62+
activesupport (= 6.1.3)
63+
activerecord (6.1.3)
64+
activemodel (= 6.1.3)
65+
activesupport (= 6.1.3)
66+
activestorage (6.1.3)
67+
actionpack (= 6.1.3)
68+
activejob (= 6.1.3)
69+
activerecord (= 6.1.3)
70+
activesupport (= 6.1.3)
71+
marcel (~> 0.3.1)
72+
mimemagic (~> 0.3.2)
73+
activesupport (6.1.3)
74+
concurrent-ruby (~> 1.0, >= 1.0.2)
75+
i18n (>= 1.6, < 2)
76+
minitest (>= 5.1)
77+
tzinfo (~> 2.0)
78+
zeitwerk (~> 2.3)
79+
builder (3.2.4)
80+
byebug (11.1.3)
81+
concurrent-ruby (1.1.8)
82+
crass (1.0.6)
83+
diff-lcs (1.4.4)
84+
docile (1.3.5)
85+
doggo (1.1.0)
86+
rspec-core (~> 3.0)
87+
erubi (1.10.0)
88+
globalid (0.4.2)
89+
activesupport (>= 4.2.0)
90+
i18n (1.8.9)
91+
concurrent-ruby (~> 1.0)
92+
json (2.5.1)
93+
loofah (2.9.0)
94+
crass (~> 1.0.2)
95+
nokogiri (>= 1.5.9)
96+
mail (2.7.1)
97+
mini_mime (>= 0.1.1)
98+
marcel (0.3.3)
99+
mimemagic (~> 0.3.2)
100+
method_source (1.0.0)
101+
mimemagic (0.3.5)
102+
mini_mime (1.0.2)
103+
mini_portile2 (2.5.0)
104+
minitest (5.14.3)
105+
nio4r (2.5.5)
106+
nokogiri (1.11.1)
107+
mini_portile2 (~> 2.5.0)
108+
racc (~> 1.4)
109+
racc (1.5.2)
110+
rack (2.2.3)
111+
rack-test (1.1.0)
112+
rack (>= 1.0, < 3)
113+
rails (6.1.3)
114+
actioncable (= 6.1.3)
115+
actionmailbox (= 6.1.3)
116+
actionmailer (= 6.1.3)
117+
actionpack (= 6.1.3)
118+
actiontext (= 6.1.3)
119+
actionview (= 6.1.3)
120+
activejob (= 6.1.3)
121+
activemodel (= 6.1.3)
122+
activerecord (= 6.1.3)
123+
activestorage (= 6.1.3)
124+
activesupport (= 6.1.3)
125+
bundler (>= 1.15.0)
126+
railties (= 6.1.3)
127+
sprockets-rails (>= 2.0.0)
128+
rails-dom-testing (2.0.3)
129+
activesupport (>= 4.2.0)
130+
nokogiri (>= 1.6)
131+
rails-html-sanitizer (1.3.0)
132+
loofah (~> 2.3)
133+
railties (6.1.3)
134+
actionpack (= 6.1.3)
135+
activesupport (= 6.1.3)
136+
method_source
137+
rake (>= 0.8.7)
138+
thor (~> 1.0)
139+
rake (13.0.3)
140+
rdoc (6.3.0)
141+
rspec-core (3.10.1)
142+
rspec-support (~> 3.10.0)
143+
rspec-expectations (3.10.1)
144+
diff-lcs (>= 1.2.0, < 2.0)
145+
rspec-support (~> 3.10.0)
146+
rspec-mocks (3.10.2)
147+
diff-lcs (>= 1.2.0, < 2.0)
148+
rspec-support (~> 3.10.0)
149+
rspec-rails (4.0.2)
150+
actionpack (>= 4.2)
151+
activesupport (>= 4.2)
152+
railties (>= 4.2)
153+
rspec-core (~> 3.10)
154+
rspec-expectations (~> 3.10)
155+
rspec-mocks (~> 3.10)
156+
rspec-support (~> 3.10)
157+
rspec-support (3.10.2)
158+
simplecov (0.21.2)
159+
docile (~> 1.1)
160+
simplecov-html (~> 0.11)
161+
simplecov_json_formatter (~> 0.1)
162+
simplecov-html (0.12.3)
163+
simplecov-rcov (0.2.3)
164+
simplecov (>= 0.4.1)
165+
simplecov_json_formatter (0.1.2)
166+
sprockets (4.0.2)
167+
concurrent-ruby (~> 1.0)
168+
rack (> 1, < 3)
169+
sprockets-rails (3.2.2)
170+
actionpack (>= 4.0)
171+
activesupport (>= 4.0)
172+
sprockets (>= 3.0.0)
173+
thor (1.1.0)
174+
tzinfo (2.0.4)
175+
concurrent-ruby (~> 1.0)
176+
websocket-driver (0.7.3)
177+
websocket-extensions (>= 0.1.0)
178+
websocket-extensions (0.1.5)
179+
zeitwerk (2.4.2)
180+
181+
PLATFORMS
182+
ruby
183+
184+
DEPENDENCIES
185+
byebug (~> 11.1)
186+
doggo (~> 1.1)
187+
rake (~> 13.0)
188+
rdoc (~> 6.3)
189+
rspec-rails (~> 4.0)
190+
scimitar!
191+
sdoc!
192+
simplecov-rcov (~> 0.2)
193+
194+
BUNDLED WITH
195+
2.1.4

LICENSE.txt

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 RIP Global
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+137
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
# Scimitar
2+
3+
[![License](https://img.shields.io/badge/license-mit-blue.svg)](https://opensource.org/licenses/MIT)
4+
5+
Comprehensive SCIM v2 support for Users and Groups in Ruby On Rails.
6+
7+
8+
9+
## Overview
10+
11+
System for Cross-domain Identity Management (SCIM) is a protocol that helps systems synchronise user data between different business systems. A _service provider_ hosts a SCIM API endpoint implementation and the Scimitar gem is used to help quickly build this implementation. One or more _enterprise subscribers_ use these APIs to let that service know about changes in the enterprise's user (employee) list.
12+
13+
In the context of the names used by the SCIM standard, the service that is provided is some kind of software-as-a-service solution that the enterprise subscriber uses to assist with their day to day business. The enterprise maintains its user (employee) list via whatever means it wants, but includes SCIM support so that any third party services it uses can be kept up to date with adds, removals or changes to employee data.
14+
15+
* [Overview](https://en.wikipedia.org/wiki/System_for_Cross-domain_Identity_Management) at Wikipedia
16+
* [More detailed introduction](http://www.simplecloud.info) at SimpleCloud
17+
* SCIM v2 RFC [7642](https://tools.ietf.org/html/rfc7642): Concepts
18+
* SCIM v2 RFC [7643](https://tools.ietf.org/html/rfc7643): Core schema
19+
* SCIM v2 RFC [7644](https://tools.ietf.org/html/rfc7644): Protocol
20+
21+
22+
23+
## Installation
24+
25+
Install using:
26+
27+
```shell
28+
gem install scimitar
29+
```
30+
31+
In your Gemfile:
32+
33+
```ruby
34+
gem 'scimitar', '~> 1.0'
35+
```
36+
37+
Scimitar uses [semantic versioning](https://semver.org) so you can be confident that patch and minor version updates for features, bug fixes and/or security patches will not break your application.
38+
39+
40+
41+
## Heritage
42+
43+
Scimitar borrow heavily - to the point of cut-and-paste - from:
44+
45+
* [Scimitar](https://github.com/Cisco-AMP/scimitar) for the Rails controllers and resource-agnostic subclassing approach that makes supporting User and/or Group, along with custom resource types if you need them, quite easy.
46+
* [ScimRails](https://github.com/lessonly/scim_rails) for the bearer token support, 'index' actions and filter support.
47+
* [Scim::Kit](https://github.com/xlgmokha/scim-kit) as a handy, formalised way to convert to/from SCIM JSON schema and your own records (be they persisted via ActiveRecord or any other means).
48+
49+
All three are provided under the MIT license. Scimitar is too.
50+
51+
52+
53+
## Usage
54+
55+
```
56+
GREAT
57+
58+
BIG
59+
60+
TO
61+
62+
DO
63+
64+
LIST
65+
66+
OF
67+
68+
STUFF
69+
70+
THAT
71+
72+
NEEDS
73+
74+
TO
75+
76+
GO
77+
78+
HERE
79+
80+
:-)
81+
82+
(I'll know it once I've built it)
83+
```
84+
85+
86+
87+
## Security
88+
89+
One IMHO under-discussed feature of SCIM is the authorisation and security model. The best resource I've found to describe this in any detail is [section 2 of the protocol RFC, 7644](https://tools.ietf.org/html/rfc7644#section-2). Often, you'll find that bearer tokens are in use by SCIM API consumers.
90+
91+
As an example, suppose a corporation uses Microsoft Azure Active Directory to maintain a master database of employee details. Azure lets administrators [connect to SCIM endpoints]() for services that this corporation might use. In all cases, bearer tokens are used.
92+
93+
* When the third party integration builds an app that it gets hosted in the Azure Marketplace, the token is obtained via full OAuth flow of some kind - the enterprise corporation would sign into your app by some OAuth UI mechanism you provide, which leads to a Bearer token being issued. Thereafter, the Azure system would quote this back to you in API calls via the `Authorization` HTTP header.
94+
95+
* If you are providing SCIM services as part of some wider service offering it might not make sense to go to the trouble of adding all the extra features and requirements for Marketplace inclusion. Fortunately, Microsoft support addition of 'user-defined' enterprise "app" integrations in Azure, so the administrator can set up and 'provision' your SCIM API endpoint. In _this_ case, the bearer token is just some string that you generate which they paste into the Azure AD UI. Clearly, then, this amounts to little more than a glorified password, but you can take steps to make sure that it's long, unguessable and potentially be some encrypted/encoded structure that allows you to make additional security checks on "your side" when you unpack the token as part of API request handling.
96+
97+
* HTTPS is obviously a given here and localhost integration during development is difficult; perhaps search around for things like POSTman collections to assist with development testing. Scimitar has a reasonably comprehensive internal test suite but it's only as good as the accuracy and reliability of the subclass code you write to "bridge the gap" between SCIM schema and actions, and your User/Group equivalent records and the operations you perform upon them.
98+
99+
100+
101+
102+
LINKS FOR
103+
https://techcommunity.microsoft.com/t5/identity-standards-blog/provisioning-with-scim-design-build-and-test-your-scim-endpoint/ba-p/1204883
104+
https://docs.microsoft.com/en-us/azure/active-directory/app-provisioning/how-provisioning-works
105+
https://docs.microsoft.com/en-us/azure/active-directory/app-provisioning/use-scim-to-provision-users-and-groups#integrate-your-scim-endpoint-with-the-aad-scim-client
106+
107+
108+
109+
## Development
110+
111+
Install dependencies first:
112+
113+
```
114+
bundle install
115+
```
116+
117+
118+
119+
## Tests
120+
121+
The tests use [RSpec](http://rspec.info):
122+
123+
```shell
124+
bundle exec rspec
125+
```
126+
127+
128+
129+
## Internal documentation
130+
131+
Regenerate the internal [`rdoc` documentation](https://ruby-doc.org/stdlib-2.4.1/libdoc/rdoc/rdoc/RDoc/Markup.html#label-Supported+Formats) with:
132+
133+
```shell
134+
bundle exec rake rerdoc
135+
```
136+
137+
...yes, that's `rerdoc` - Re-R-Doc.

0 commit comments

Comments
 (0)