omniauth-dnanexus 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 5bc7db96376c80561844bf3b28ba26985c23a6bdff6eca6180e2e089e7e8683b
4
+ data.tar.gz: ccbfc0ba353080882aa6be789e998782c7368b62cb3b3fbc2ec7ca1fa48139f3
5
+ SHA512:
6
+ metadata.gz: 57c8795f54b75c185834464f6cd286a35fb78b474b157ccad8c054acd924ae08e6d619b07a8770b01ec3b9d543d277a56b370f17375dcafcb75465323c26538b
7
+ data.tar.gz: ad63b5a4311fd9b533f3fe1193c9481cfc809ba61d56a0dcd5bfaf1821b693399d9f25dbc074e1315634284847bdc6bda2a4d41abf07132c0080f377d472c24d
@@ -0,0 +1,36 @@
1
+ # From: https://github.com/hopsoft/stimulus_reflex/blob/master/.github/workflows/changelog.yml
2
+ name: Changelog
3
+
4
+ on:
5
+ workflow_dispatch:
6
+ release:
7
+ types: [created]
8
+ push:
9
+ branches:
10
+ - main
11
+
12
+ jobs:
13
+ build:
14
+ runs-on: ubuntu-latest
15
+ timeout-minutes: 4
16
+ if: "!contains(github.event.head_commit.message, '[nodoc]')"
17
+ steps:
18
+ - uses: actions/checkout@master
19
+ - name: Set up Ruby
20
+ uses: ruby/setup-ruby@v1
21
+ with:
22
+ ruby-version: 3.0
23
+ bundler-cache: true
24
+ - name: Create local changes
25
+ run: |
26
+ bundle exec github_changelog_generator -u ${{ github.repository_owner }} -p ${{ github.event.repository.name }} --token ${{ secrets.GITHUB_TOKEN }} --exclude-labels duplicate,question,invalid,wontfix,nodoc
27
+ - name: Commit files
28
+ run: |
29
+ git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
30
+ git config --local user.name "github-actions[bot]"
31
+ git commit -am "[nodoc] Update Changelog" || echo "No changes to commit"
32
+ - name: Push changes
33
+ uses: ad-m/github-push-action@master
34
+ with:
35
+ github_token: ${{ secrets.GITHUB_TOKEN }}
36
+ branch: ${{ github.ref }}
@@ -0,0 +1,48 @@
1
+ name: CI
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches: [main]
7
+ schedule:
8
+ - cron: '0 0 * * *'
9
+
10
+ env:
11
+ GIT_COMMIT_SHA: ${{ github.sha }}
12
+ GIT_BRANCH: ${{ github.ref }}
13
+
14
+ jobs:
15
+ linting:
16
+ runs-on: ubuntu-latest
17
+
18
+ steps:
19
+ - uses: actions/checkout@v1
20
+
21
+ - name: Set up Ruby 2.7
22
+ uses: ruby/setup-ruby@v1
23
+ with:
24
+ ruby-version: 2.7
25
+ bundler-cache: true
26
+
27
+ - name: Standard
28
+ run: |
29
+ bundle exec standardrb
30
+ build:
31
+ needs: [linting]
32
+ runs-on: ubuntu-latest
33
+ strategy:
34
+ matrix:
35
+ ruby: ['2.5', '2.6', '2.7', '3.0']
36
+
37
+ steps:
38
+ - uses: actions/checkout@v1
39
+
40
+ - name: Set up Ruby
41
+ uses: ruby/setup-ruby@v1
42
+ with:
43
+ ruby-version: ${{ matrix.ruby }}
44
+ bundler-cache: true
45
+
46
+ - name: Test
47
+ run: |
48
+ bundle exec rake
@@ -0,0 +1,29 @@
1
+ name: Publish
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ build:
9
+ name: Publish to Rubygems
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - uses: actions/checkout@master
14
+
15
+ - name: Set up Ruby
16
+ uses: actions/setup-ruby@v1
17
+ with:
18
+ ruby-version: 2.7.x
19
+
20
+ - name: Publish to RubyGems
21
+ run: |
22
+ mkdir -p $HOME/.gem
23
+ touch $HOME/.gem/credentials
24
+ chmod 0600 $HOME/.gem/credentials
25
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
26
+ gem build omniauth-dnanexus.gemspec
27
+ gem push omniauth-dnanexus-*.gem
28
+ env:
29
+ GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_AUTH_TOKEN }}
data/.gitignore ADDED
@@ -0,0 +1,19 @@
1
+ .idea/
2
+ .bundle/
3
+ .yardoc
4
+ _yardoc/
5
+ coverage/
6
+ doc/
7
+ pkg/
8
+ spec/reports/
9
+ tmp/
10
+
11
+ *.gem
12
+ gemfile.lock
13
+
14
+ .rvmrc
15
+ .ruby-version
16
+
17
+ .rspec_status
18
+
19
+ /coverage/
data/CHANGELOG.md ADDED
@@ -0,0 +1,15 @@
1
+ # Changelog
2
+
3
+ ## [Unreleased](https://github.com/MikeRogers0/omniauth-dnanexus/tree/HEAD)
4
+
5
+ [Full Changelog](https://github.com/MikeRogers0/omniauth-dnanexus/compare/c419477e02461b4bc41b754f0daeaa997fb7ad1f...HEAD)
6
+
7
+ **Merged pull requests:**
8
+
9
+ - feat: Automate the changelog [\#3](https://github.com/MikeRogers0/omniauth-dnanexus/pull/3) ([MikeRogers0](https://github.com/MikeRogers0))
10
+ - fix: Correcting gem name in GH Action [\#2](https://github.com/MikeRogers0/omniauth-dnanexus/pull/2) ([MikeRogers0](https://github.com/MikeRogers0))
11
+ - refactor: Consistent capitalisation for DNAnexus [\#1](https://github.com/MikeRogers0/omniauth-dnanexus/pull/1) ([MikeRogers0](https://github.com/MikeRogers0))
12
+
13
+
14
+
15
+ \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Mike Rogers
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.
data/README.md ADDED
@@ -0,0 +1,44 @@
1
+ # OmniAuth::DNAnexus
2
+
3
+ OmniAuth strategy for [DNAnexus](https://documentation.dnanexus.com/developer/api/authentication).
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ $ bundle add omniauth-dnanexus
9
+ ```
10
+ ## Usage
11
+
12
+ ```ruby
13
+ Rails.application.config.middleware.use OmniAuth::Builder do
14
+ provider :dnanexus, ENV["DNANEXUS_CLIENT_ID"], ENV["DNANEXUS_CLIENT_SECRET"], {
15
+ dnanexus_api_endpoint: "https://api.dnanexus.com",
16
+ client_options: {
17
+ site: "https://auth.dnanexus.com",
18
+ authorize_url: "/oauth2/authorize",
19
+ token_url: "/oauth2/token"
20
+ }
21
+ }
22
+ end
23
+ ```
24
+
25
+ ### DNAnexus Staging
26
+
27
+ ```ruby
28
+ Rails.application.config.middleware.use OmniAuth::Builder do
29
+ provider :dnanexus, ENV["DNANEXUS_CLIENT_ID"], ENV["DNANEXUS_CLIENT_SECRET"], {
30
+ dnanexus_api_endpoint: "https://stagingapi.dnanexus.com",
31
+ client_options: {
32
+ site: "https://stagingauth.dnanexus.com"
33
+ }
34
+ }
35
+ end
36
+ ```
37
+
38
+ ## Contributing
39
+
40
+ Bug reports and pull requests are welcome on GitHub at https://github.com/MikeRogers0/omniauth-dnanexus
41
+
42
+ ## License
43
+
44
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new
5
+
6
+ task default: :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "omniauth/dnanexus"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1 @@
1
+ require "omniauth/dnanexus"
@@ -0,0 +1,2 @@
1
+ require "omniauth/dnanexus/version"
2
+ require "omniauth/strategies/dnanexus"
@@ -0,0 +1,5 @@
1
+ module OmniAuth
2
+ module DNAnexus
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,54 @@
1
+ require "omniauth-oauth2"
2
+
3
+ module OmniAuth
4
+ module Strategies
5
+ class DNAnexus < OmniAuth::Strategies::OAuth2
6
+ option :name, "dnanexus"
7
+
8
+ # This is where you pass the options you would pass when
9
+ # initializing your consumer from the OAuth gem.
10
+ option :client_options, {
11
+ site: "https://auth.dnanexus.com",
12
+ authorize_url: "/oauth2/authorize",
13
+ token_url: "/oauth2/token"
14
+ }
15
+
16
+ option :dnanexus_api_endpoint, "https://api.dnanexus.com"
17
+
18
+ # These are called after authentication has succeeded. If
19
+ # possible, you should try to set the UID without making
20
+ # additional calls (if the user id is returned with the token
21
+ # or as a URI parameter). This may not be possible with all
22
+ # providers.
23
+ uid { raw_info["id"] }
24
+
25
+ info do
26
+ {
27
+ email: raw_info["email"],
28
+ handle: raw_info["handle"],
29
+ first: raw_info["first"],
30
+ middle: raw_info["middle"],
31
+ last: raw_info["last"]
32
+ }
33
+ end
34
+
35
+ extra do
36
+ {
37
+ "raw_info" => raw_info
38
+ }
39
+ end
40
+
41
+ def raw_info
42
+ @raw_info ||= access_token.post(
43
+ "#{options.dnanexus_api_endpoint}/#{access_token.params["user_id"]}/describe",
44
+ body: "{}",
45
+ headers: {
46
+ "Content-Type" => "application/json"
47
+ }
48
+ ).parsed
49
+ end
50
+ end
51
+ end
52
+ end
53
+
54
+ OmniAuth.config.add_camelization "dnanexus", "DNAnexus"
@@ -0,0 +1,32 @@
1
+ lib = File.expand_path("../lib", __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require "omniauth/dnanexus/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "omniauth-dnanexus"
7
+ spec.version = OmniAuth::DNAnexus::VERSION
8
+ spec.authors = ["Mike Rogers"]
9
+ spec.email = ["me@mikerogers.io"]
10
+
11
+ spec.summary = "OmniAuth strategy for DNAnexus"
12
+ spec.description = "OmniAuth strategy for DNAnexus"
13
+ spec.homepage = "https://github.com/MikeRogers0/omniauth-dnanexus"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = Dir.chdir(File.expand_path("..", __FILE__)) do
17
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ end
19
+ spec.bindir = "exe"
20
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
+ spec.require_paths = ["lib"]
22
+
23
+ spec.add_dependency "omniauth-oauth2"
24
+ spec.add_dependency "jwt"
25
+ spec.add_development_dependency "bundler", "~> 2.0"
26
+ spec.add_development_dependency "rake", "~> 13.0"
27
+ spec.add_development_dependency "rspec", "~> 3.9"
28
+ spec.add_development_dependency "webmock", "~> 3.8"
29
+ spec.add_development_dependency "simplecov", "~> 0.18"
30
+ spec.add_development_dependency "standard", "~> 1.1"
31
+ spec.add_development_dependency "github_changelog_generator", "~> 1.15"
32
+ end
metadata ADDED
@@ -0,0 +1,185 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-dnanexus
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Mike Rogers
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2021-07-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: omniauth-oauth2
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: jwt
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '2.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '2.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '13.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '13.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '3.9'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '3.9'
83
+ - !ruby/object:Gem::Dependency
84
+ name: webmock
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '3.8'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '3.8'
97
+ - !ruby/object:Gem::Dependency
98
+ name: simplecov
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '0.18'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '0.18'
111
+ - !ruby/object:Gem::Dependency
112
+ name: standard
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '1.1'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '1.1'
125
+ - !ruby/object:Gem::Dependency
126
+ name: github_changelog_generator
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '1.15'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '1.15'
139
+ description: OmniAuth strategy for DNAnexus
140
+ email:
141
+ - me@mikerogers.io
142
+ executables: []
143
+ extensions: []
144
+ extra_rdoc_files: []
145
+ files:
146
+ - ".github/workflows/changelog.yml"
147
+ - ".github/workflows/ci.yml"
148
+ - ".github/workflows/publish.yml"
149
+ - ".gitignore"
150
+ - CHANGELOG.md
151
+ - Gemfile
152
+ - LICENSE
153
+ - README.md
154
+ - Rakefile
155
+ - bin/console
156
+ - bin/setup
157
+ - lib/omniauth-dnanexus.rb
158
+ - lib/omniauth/dnanexus.rb
159
+ - lib/omniauth/dnanexus/version.rb
160
+ - lib/omniauth/strategies/dnanexus.rb
161
+ - omniauth-dnanexus.gemspec
162
+ homepage: https://github.com/MikeRogers0/omniauth-dnanexus
163
+ licenses:
164
+ - MIT
165
+ metadata: {}
166
+ post_install_message:
167
+ rdoc_options: []
168
+ require_paths:
169
+ - lib
170
+ required_ruby_version: !ruby/object:Gem::Requirement
171
+ requirements:
172
+ - - ">="
173
+ - !ruby/object:Gem::Version
174
+ version: '0'
175
+ required_rubygems_version: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - ">="
178
+ - !ruby/object:Gem::Version
179
+ version: '0'
180
+ requirements: []
181
+ rubygems_version: 3.1.6
182
+ signing_key:
183
+ specification_version: 4
184
+ summary: OmniAuth strategy for DNAnexus
185
+ test_files: []