omniauth-icalia 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/omniauth-icalia/version.rb +1 -1
- data/lib/omniauth/strategies/icalia.rb +9 -1
- data/omniauth-icalia.gemspec +2 -2
- metadata +12 -24
- data/.dockerignore +0 -45
- data/.gitignore +0 -18
- data/.rspec +0 -3
- data/.semaphore/bin/docker-image-manager +0 -161
- data/.semaphore/bin/generate-dotenv-file +0 -16
- data/.semaphore/publishing.yml +0 -62
- data/.semaphore/semaphore.yml +0 -111
- data/.travis.yml +0 -7
- data/Dockerfile +0 -22
- data/Gemfile +0 -9
- data/Gemfile.lock +0 -86
- data/ci-compose.yml +0 -41
- data/docker-compose.yml +0 -20
- data/spec/omniauth/strategies/icalia_spec.rb +0 -109
- data/spec/spec_helper.rb +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 864c313673647f747871ee2111f655b66c71a45868a0e176a7365eee7bbd40d0
|
4
|
+
data.tar.gz: c88f092f924a9828dbdbe6d47bf7ecbd51ba937df3a29ef256a18ebe3ee7db73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b5743a0b47f00ee0ed729c046da7d5286c598586d0b31a6d80495a0f739e22204ca6d2258a2d6c687f1f369cfbc7af2de6989c7d636c5c0adfa5d1087ba95e9
|
7
|
+
data.tar.gz: 07e308c264cd88b65d299007c2977ea06c705e731adfa7fb59bc4fded03f89ed6d729b607b1b0e47547e3a8d2f675f022a53d2529369d47a77799641b0344938
|
@@ -29,7 +29,15 @@ module OmniAuth
|
|
29
29
|
uid { raw_info.resource_owner.id.to_s }
|
30
30
|
|
31
31
|
info do
|
32
|
-
|
32
|
+
personal_info = raw_info.resource_owner
|
33
|
+
{
|
34
|
+
'full_name' => personal_info.full_name,
|
35
|
+
'given_name' => personal_info.given_name,
|
36
|
+
'family_name' => personal_info.family_name,
|
37
|
+
'gender_type' => personal_info.gender_type,
|
38
|
+
'custom_gender' => personal_info.custom_gender,
|
39
|
+
'date_of_birth' => personal_info.date_of_birth
|
40
|
+
}
|
33
41
|
end
|
34
42
|
|
35
43
|
extra do
|
data/omniauth-icalia.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.license = 'MIT'
|
13
13
|
|
14
14
|
spec.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
15
|
-
spec.files = `git ls-files`.split("\n")
|
15
|
+
spec.files = `git ls-files -- lib/* *.md *.gemspec *.txt Rakefile`.split("\n")
|
16
16
|
spec.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
17
17
|
spec.name = 'omniauth-icalia'
|
18
18
|
spec.require_paths = ['lib']
|
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
|
21
21
|
spec.add_dependency 'omniauth', '~> 1.5'
|
22
22
|
spec.add_dependency 'omniauth-oauth2', '>= 1.4.0', '< 2.0'
|
23
|
-
spec.add_dependency 'icalia-sdk-event-core', '~> 0.3.3'
|
23
|
+
spec.add_dependency 'icalia-sdk-event-core', '~> 0.3.4', '>= 0.3.4'
|
24
24
|
|
25
25
|
spec.add_development_dependency 'bundler', '~> 1.17'
|
26
26
|
spec.add_development_dependency 'rake', '~> 10.0'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-icalia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Quintanilla
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-02-
|
11
|
+
date: 2020-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth
|
@@ -48,16 +48,22 @@ dependencies:
|
|
48
48
|
name: icalia-sdk-event-core
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 0.3.4
|
51
54
|
- - "~>"
|
52
55
|
- !ruby/object:Gem::Version
|
53
|
-
version: 0.3.
|
56
|
+
version: 0.3.4
|
54
57
|
type: :runtime
|
55
58
|
prerelease: false
|
56
59
|
version_requirements: !ruby/object:Gem::Requirement
|
57
60
|
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: 0.3.4
|
58
64
|
- - "~>"
|
59
65
|
- !ruby/object:Gem::Version
|
60
|
-
version: 0.3.
|
66
|
+
version: 0.3.4
|
61
67
|
- !ruby/object:Gem::Dependency
|
62
68
|
name: bundler
|
63
69
|
requirement: !ruby/object:Gem::Requirement
|
@@ -109,31 +115,16 @@ executables:
|
|
109
115
|
extensions: []
|
110
116
|
extra_rdoc_files: []
|
111
117
|
files:
|
112
|
-
- ".dockerignore"
|
113
|
-
- ".gitignore"
|
114
|
-
- ".rspec"
|
115
|
-
- ".semaphore/bin/docker-image-manager"
|
116
|
-
- ".semaphore/bin/generate-dotenv-file"
|
117
|
-
- ".semaphore/publishing.yml"
|
118
|
-
- ".semaphore/semaphore.yml"
|
119
|
-
- ".travis.yml"
|
120
118
|
- CODE_OF_CONDUCT.md
|
121
|
-
- Dockerfile
|
122
|
-
- Gemfile
|
123
|
-
- Gemfile.lock
|
124
119
|
- LICENSE.txt
|
125
120
|
- README.md
|
126
121
|
- Rakefile
|
127
122
|
- bin/console
|
128
123
|
- bin/setup
|
129
|
-
- ci-compose.yml
|
130
|
-
- docker-compose.yml
|
131
124
|
- lib/omniauth-icalia.rb
|
132
125
|
- lib/omniauth-icalia/version.rb
|
133
126
|
- lib/omniauth/strategies/icalia.rb
|
134
127
|
- omniauth-icalia.gemspec
|
135
|
-
- spec/omniauth/strategies/icalia_spec.rb
|
136
|
-
- spec/spec_helper.rb
|
137
128
|
homepage: https://github.com/IcaliaLabs/omniauth-icalia
|
138
129
|
licenses:
|
139
130
|
- MIT
|
@@ -153,11 +144,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
153
144
|
- !ruby/object:Gem::Version
|
154
145
|
version: '0'
|
155
146
|
requirements: []
|
156
|
-
|
157
|
-
rubygems_version: 2.7.6
|
147
|
+
rubygems_version: 3.0.3
|
158
148
|
signing_key:
|
159
149
|
specification_version: 4
|
160
150
|
summary: Official Omniauth Strategy for Icalia.
|
161
|
-
test_files:
|
162
|
-
- spec/omniauth/strategies/icalia_spec.rb
|
163
|
-
- spec/spec_helper.rb
|
151
|
+
test_files: []
|
data/.dockerignore
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
# Ignore docker and environment files:
|
2
|
-
*Dockerfile*
|
3
|
-
docker-compose*.yml
|
4
|
-
ci-compose.yml
|
5
|
-
**/*.env
|
6
|
-
.dockerignore
|
7
|
-
|
8
|
-
# Ignore Git repositories:
|
9
|
-
**/.git
|
10
|
-
|
11
|
-
# Ignore temporary files:
|
12
|
-
**/tmp/
|
13
|
-
|
14
|
-
# Ignore OS artifacts:
|
15
|
-
**/.DS_Store
|
16
|
-
|
17
|
-
# 3: Ignore Development container's Home artifacts:
|
18
|
-
# 3.1: Ignore bash / IRB / Byebug history files
|
19
|
-
.*_hist*
|
20
|
-
|
21
|
-
# 3.3: bundler stuff
|
22
|
-
.bundle/*
|
23
|
-
|
24
|
-
# 3.4: Codeclimate stuff:
|
25
|
-
.codeclimate.yml
|
26
|
-
.csslintrc
|
27
|
-
.eslintignore
|
28
|
-
.eslintrc
|
29
|
-
.rubocop.yml
|
30
|
-
coffeelint.json
|
31
|
-
|
32
|
-
# Ignore test coverage reports:
|
33
|
-
coverage/*
|
34
|
-
|
35
|
-
# Ignore auto-downloadable codeclimate plugin configuration files:
|
36
|
-
.rubocop.yml
|
37
|
-
.rubocop-rails.yml
|
38
|
-
.reek
|
39
|
-
.scss-lint.yml
|
40
|
-
|
41
|
-
examples.txt
|
42
|
-
|
43
|
-
**/.gem
|
44
|
-
/.semaphore
|
45
|
-
/tmp
|
data/.gitignore
DELETED
data/.rspec
DELETED
@@ -1,161 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
# Y yo pelándomela con bash...
|
5
|
-
|
6
|
-
def load_env
|
7
|
-
File.read('.env').each_line do |line|
|
8
|
-
variable_name, variable_value = line.match(/\A(\w+)=(\S*)/).captures
|
9
|
-
next if variable_name.nil?
|
10
|
-
ENV[variable_name] = variable_value
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
def main_image
|
15
|
-
@main_image ||= @config.dig 'services', @service_name, 'image'
|
16
|
-
end
|
17
|
-
|
18
|
-
def image_repo
|
19
|
-
@image_repo ||= image_and_tag(main_image).first
|
20
|
-
end
|
21
|
-
|
22
|
-
def image_and_tag(image)
|
23
|
-
image.match(/\A(\S+):(\S*)\z/).captures
|
24
|
-
end
|
25
|
-
|
26
|
-
def pull(image)
|
27
|
-
system('docker', 'pull', image, out: $stdout, err: :out)
|
28
|
-
end
|
29
|
-
|
30
|
-
def pull_main_image
|
31
|
-
pull main_image
|
32
|
-
end
|
33
|
-
|
34
|
-
def sorted_cache_images
|
35
|
-
unsorted_images = @config
|
36
|
-
.dig('services', @service_name, 'build', 'cache_from')
|
37
|
-
.reject { |image| image == main_image }
|
38
|
-
.uniq
|
39
|
-
|
40
|
-
# With priority:
|
41
|
-
sorted_images = []
|
42
|
-
|
43
|
-
# 1: Testing of commit:
|
44
|
-
sorted_images << unsorted_images.detect do |image|
|
45
|
-
image == "#{image_repo}:testing-#{ENV['GIT_SHORT_SHA']}"
|
46
|
-
end
|
47
|
-
|
48
|
-
# 2: Builder of branch:
|
49
|
-
sorted_images << unsorted_images.detect do |image|
|
50
|
-
image == "#{image_repo}:builder-#{ENV['TAG_SAFE_BRANCH']}"
|
51
|
-
end
|
52
|
-
|
53
|
-
# 3: Testing of branch:
|
54
|
-
sorted_images << unsorted_images.detect do |image|
|
55
|
-
image == "#{image_repo}:testing-#{ENV['TAG_SAFE_BRANCH']}"
|
56
|
-
end
|
57
|
-
|
58
|
-
# 4: Builder of master branch:
|
59
|
-
sorted_images << unsorted_images.detect do |image|
|
60
|
-
image == "#{image_repo}:builder"
|
61
|
-
end
|
62
|
-
|
63
|
-
# 5: Testing of master branch:
|
64
|
-
sorted_images << unsorted_images.detect do |image|
|
65
|
-
image == "#{image_repo}:testing"
|
66
|
-
end
|
67
|
-
|
68
|
-
(sorted_images + (unsorted_images - sorted_images))
|
69
|
-
.reject { |image| "#{image}" == '' }
|
70
|
-
end
|
71
|
-
|
72
|
-
def pull_cache_images
|
73
|
-
repo_image_pulled = false
|
74
|
-
sorted_cache_images.each do |image|
|
75
|
-
is_repo_image = image.start_with?(image_repo)
|
76
|
-
next if is_repo_image && repo_image_pulled
|
77
|
-
repo_image_pulled = pull(image) && is_repo_image
|
78
|
-
end
|
79
|
-
end
|
80
|
-
|
81
|
-
def push(image)
|
82
|
-
system 'docker', 'push', image, out: $stdout, err: :out
|
83
|
-
end
|
84
|
-
|
85
|
-
def tag(source_image, target_image)
|
86
|
-
system 'docker', 'tag', source_image, target_image, out: $stdout, err: :out
|
87
|
-
end
|
88
|
-
|
89
|
-
def tag_and_push_branch
|
90
|
-
branch_image = main_image
|
91
|
-
.gsub(ENV['GIT_SHORT_SHA'], ENV['TAG_SAFE_BRANCH'])
|
92
|
-
|
93
|
-
branch_image = branch_image[0..-8] if branch_image =~ /:(\w+)-master\z/
|
94
|
-
|
95
|
-
tag main_image, branch_image
|
96
|
-
push branch_image
|
97
|
-
end
|
98
|
-
|
99
|
-
def tag_and_push_latest
|
100
|
-
# We'll only tag 'testing', 'builder' or 'latest' if we're on master:
|
101
|
-
return unless ENV['TAG_SAFE_BRANCH'] == 'master'
|
102
|
-
|
103
|
-
latest_image = main_image.gsub(ENV['GIT_SHORT_SHA'], '')
|
104
|
-
|
105
|
-
if latest_image.end_with?('-')
|
106
|
-
# It's either a 'builder' or 'testing' tag:
|
107
|
-
latest_image = latest_image[0..-2]
|
108
|
-
elsif latest_image.end_with?(':')
|
109
|
-
# It's neither a 'builder' or 'testing' tag:
|
110
|
-
latest_image = "#{latest_image}latest"
|
111
|
-
end
|
112
|
-
|
113
|
-
tag main_image, latest_image
|
114
|
-
push latest_image
|
115
|
-
end
|
116
|
-
|
117
|
-
def push_images
|
118
|
-
push main_image
|
119
|
-
tag_and_push_branch
|
120
|
-
tag_and_push_latest
|
121
|
-
end
|
122
|
-
|
123
|
-
@command = ARGV[0]
|
124
|
-
unless %w[download-cache tag-and-push].include?(@command)
|
125
|
-
puts "Command '#{@command}' not recognized"
|
126
|
-
exit 1
|
127
|
-
end
|
128
|
-
|
129
|
-
@service_name = ARGV[1]
|
130
|
-
if "#{@service_name}" == ''
|
131
|
-
puts "No service name given"
|
132
|
-
exit 1
|
133
|
-
end
|
134
|
-
|
135
|
-
@config ||= begin
|
136
|
-
require 'yaml'
|
137
|
-
config_str = %x[docker-compose --file docker-compose.yml --file ci-compose.yml config]
|
138
|
-
YAML.load config_str
|
139
|
-
rescue
|
140
|
-
puts config_str
|
141
|
-
exit 1
|
142
|
-
end
|
143
|
-
|
144
|
-
if "#{@service_name}" == ''
|
145
|
-
puts "No service name given"
|
146
|
-
exit 1
|
147
|
-
end
|
148
|
-
|
149
|
-
if @config.dig('services', @service_name).nil?
|
150
|
-
puts "No service '#{@service_name}' exists in config"
|
151
|
-
exit 1
|
152
|
-
end
|
153
|
-
|
154
|
-
load_env
|
155
|
-
|
156
|
-
case @command
|
157
|
-
when 'download-cache'
|
158
|
-
pull_main_image || pull_cache_images
|
159
|
-
when 'tag-and-push'
|
160
|
-
push_images
|
161
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
|
3
|
-
# Exit immediately if a command exits with a non-zero status:
|
4
|
-
set -e
|
5
|
-
|
6
|
-
CONTEXT_DIR=$(pwd)
|
7
|
-
|
8
|
-
GIT_SHORT_SHA=${SEMAPHORE_GIT_SHA:0:7}
|
9
|
-
BUILD_DATE=$(date +%Y-%m-%dT%H:%M:%S%z)
|
10
|
-
TAG_SAFE_BRANCH=$(echo ${SEMAPHORE_GIT_BRANCH} | tr '/' '-')
|
11
|
-
|
12
|
-
echo "BUILD_DATE=${BUILD_DATE}"
|
13
|
-
echo "GIT_SHA=${SEMAPHORE_GIT_SHA}"
|
14
|
-
echo "GIT_SHORT_SHA=${GIT_SHORT_SHA}"
|
15
|
-
echo "GIT_BRANCH=${SEMAPHORE_GIT_BRANCH}"
|
16
|
-
echo "TAG_SAFE_BRANCH=${TAG_SAFE_BRANCH}"
|
data/.semaphore/publishing.yml
DELETED
@@ -1,62 +0,0 @@
|
|
1
|
-
version: v1.0
|
2
|
-
|
3
|
-
name: 'Publishing Pipeline'
|
4
|
-
|
5
|
-
agent:
|
6
|
-
machine:
|
7
|
-
type: e1-standard-2
|
8
|
-
os_image: ubuntu1804
|
9
|
-
|
10
|
-
blocks:
|
11
|
-
- name: Publish to Rubygems
|
12
|
-
task:
|
13
|
-
secrets:
|
14
|
-
- name: AWS
|
15
|
-
- name: ICALIA_RUBYGEMS
|
16
|
-
prologue:
|
17
|
-
commands:
|
18
|
-
- checkout
|
19
|
-
|
20
|
-
# Correct the permissions on rubygems credentials:
|
21
|
-
- chmod 0600 /home/semaphore/.gem/credentials
|
22
|
-
|
23
|
-
# Add the scripts for CI to the PATH:
|
24
|
-
- export PATH=$(pwd)/.semaphore/bin:${PATH}
|
25
|
-
|
26
|
-
# Generate the dotenv file:
|
27
|
-
- generate-dotenv-file > .env
|
28
|
-
|
29
|
-
# Alias docker-compose commands as 'ci-compose':
|
30
|
-
- alias ci-compose="docker-compose --file docker-compose.yml --file ci-compose.yml"
|
31
|
-
|
32
|
-
# Log in to AWS ECR:
|
33
|
-
- $(aws ecr get-login --no-include-email --region eu-central-1)
|
34
|
-
|
35
|
-
# Pull the images referenced in the 'cache_from' key:
|
36
|
-
- docker-image-manager download-cache libraries
|
37
|
-
|
38
|
-
jobs:
|
39
|
-
- name: Event Core
|
40
|
-
commands:
|
41
|
-
# Build & publish the gem
|
42
|
-
- ci-compose run event_core rake release
|
43
|
-
|
44
|
-
- name: Event Notification
|
45
|
-
commands:
|
46
|
-
# Build & publish the gem
|
47
|
-
- ci-compose run event_notification rake release
|
48
|
-
|
49
|
-
- name: Event Webhook
|
50
|
-
commands:
|
51
|
-
# Build & publish the gem
|
52
|
-
- ci-compose run event_webhook rake release
|
53
|
-
|
54
|
-
- name: Event Meta
|
55
|
-
commands:
|
56
|
-
# Build & publish the gem
|
57
|
-
- ci-compose run event_meta rake release
|
58
|
-
|
59
|
-
- name: SDK Meta
|
60
|
-
commands:
|
61
|
-
# Build & publish the gem
|
62
|
-
- ci-compose run sdk_meta rake release
|
data/.semaphore/semaphore.yml
DELETED
@@ -1,111 +0,0 @@
|
|
1
|
-
version: v1.0
|
2
|
-
|
3
|
-
name: 'Main Pipeline'
|
4
|
-
|
5
|
-
agent:
|
6
|
-
machine:
|
7
|
-
type: e1-standard-2
|
8
|
-
os_image: ubuntu1804
|
9
|
-
|
10
|
-
blocks:
|
11
|
-
- name: Build Test Image
|
12
|
-
task:
|
13
|
-
secrets:
|
14
|
-
- name: AWS
|
15
|
-
prologue:
|
16
|
-
commands:
|
17
|
-
- checkout
|
18
|
-
|
19
|
-
# Add the scripts for CI to the PATH:
|
20
|
-
- export PATH=$(pwd)/.semaphore/bin:${PATH}
|
21
|
-
|
22
|
-
# Generate the dotenv file:
|
23
|
-
- generate-dotenv-file > .env
|
24
|
-
|
25
|
-
# Alias docker-compose commands as 'ci-compose':
|
26
|
-
- alias ci-compose="docker-compose --file docker-compose.yml --file ci-compose.yml"
|
27
|
-
|
28
|
-
# Log in to AWS ECR:
|
29
|
-
- $(aws ecr get-login --no-include-email --region eu-central-1)
|
30
|
-
jobs:
|
31
|
-
- name: Build
|
32
|
-
commands:
|
33
|
-
# Pull the images referenced in the 'cache_from' key:
|
34
|
-
- docker-image-manager download-cache libraries
|
35
|
-
|
36
|
-
# Build the test image:
|
37
|
-
- ci-compose build --pull libraries
|
38
|
-
|
39
|
-
# Tag & Push test image so we can use it on image cache:
|
40
|
-
- docker-image-manager tag-and-push libraries
|
41
|
-
|
42
|
-
- name: SDK Tests
|
43
|
-
task:
|
44
|
-
secrets:
|
45
|
-
- name: AWS
|
46
|
-
prologue:
|
47
|
-
commands:
|
48
|
-
- checkout
|
49
|
-
|
50
|
-
# Add the scripts for CI to the PATH:
|
51
|
-
- export PATH=$(pwd)/.semaphore/bin:${PATH}
|
52
|
-
|
53
|
-
# Generate the dotenv file:
|
54
|
-
- generate-dotenv-file > .env
|
55
|
-
|
56
|
-
# Alias docker-compose commands as 'ci-compose':
|
57
|
-
- alias ci-compose="docker-compose --file docker-compose.yml --file ci-compose.yml"
|
58
|
-
|
59
|
-
# Log in to AWS ECR:
|
60
|
-
- $(aws ecr get-login --no-include-email --region eu-central-1)
|
61
|
-
|
62
|
-
# Pull the images referenced in the 'cache_from' key:
|
63
|
-
- docker-image-manager download-cache libraries
|
64
|
-
jobs:
|
65
|
-
- name: Event Core
|
66
|
-
commands:
|
67
|
-
# Run the tests
|
68
|
-
- ci-compose run event_core rake spec
|
69
|
-
|
70
|
-
# Build the gem
|
71
|
-
- ci-compose run event_core gem build icalia-sdk-event-core
|
72
|
-
|
73
|
-
- name: Event Notification
|
74
|
-
commands:
|
75
|
-
# Run the tests
|
76
|
-
- ci-compose run event_notification rake spec
|
77
|
-
|
78
|
-
# Build the gem
|
79
|
-
- ci-compose run event_notification gem build icalia-sdk-event-notification
|
80
|
-
|
81
|
-
- name: Event Webhook
|
82
|
-
commands:
|
83
|
-
# Run the tests
|
84
|
-
- ci-compose run event_webhook rake spec
|
85
|
-
|
86
|
-
# Build the gem
|
87
|
-
- ci-compose run event_webhook gem build icalia-sdk-event-webhook
|
88
|
-
|
89
|
-
- name: Event Meta
|
90
|
-
commands:
|
91
|
-
# Run the tests
|
92
|
-
- ci-compose run event_meta rake spec
|
93
|
-
|
94
|
-
# Build the gem
|
95
|
-
- ci-compose run event_meta gem build icalia-sdk-event
|
96
|
-
|
97
|
-
- name: SDK Meta
|
98
|
-
commands:
|
99
|
-
# Run the tests
|
100
|
-
- ci-compose run sdk_meta rake spec
|
101
|
-
|
102
|
-
# Build the gem
|
103
|
-
- ci-compose run sdk_meta gem build icalia-sdk
|
104
|
-
|
105
|
-
promotions:
|
106
|
-
- name: Publish
|
107
|
-
pipeline_file: publishing.yml
|
108
|
-
auto_promote_on:
|
109
|
-
- result: passed
|
110
|
-
branch:
|
111
|
-
- ^refs\/tags\/v(\d+)\.(\d+)\.(\d+)(\.rc\d+)?$
|
data/.travis.yml
DELETED
data/Dockerfile
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
FROM ruby:2.6.5-buster AS development
|
2
|
-
|
3
|
-
WORKDIR /usr/src
|
4
|
-
|
5
|
-
ENV HOME=/usr/src PATH=/usr/src/bin:$PATH
|
6
|
-
|
7
|
-
COPY Gemfile Gemfile.lock omniauth-icalia.gemspec /usr/src/
|
8
|
-
COPY lib/omniauth-icalia/version.rb /usr/src/lib/omniauth-icalia/
|
9
|
-
|
10
|
-
RUN bundle install --jobs=4 --retry=3
|
11
|
-
|
12
|
-
ARG DEVELOPER_UID=1000
|
13
|
-
|
14
|
-
ARG DEVELOPER_USERNAME=you
|
15
|
-
|
16
|
-
ENV DEVELOPER_UID=${DEVELOPER_UID}
|
17
|
-
|
18
|
-
RUN useradd -r -M -u ${DEVELOPER_UID} -d /usr/src -c "Developer User,,," ${DEVELOPER_USERNAME}
|
19
|
-
|
20
|
-
FROM development AS testing
|
21
|
-
|
22
|
-
COPY . /usr/src/
|
data/Gemfile
DELETED
data/Gemfile.lock
DELETED
@@ -1,86 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
omniauth-icalia (0.1.0)
|
5
|
-
icalia-sdk-event-core (>= 0.3.3)
|
6
|
-
omniauth (~> 1.5)
|
7
|
-
omniauth-oauth2 (>= 1.4.0, < 2.0)
|
8
|
-
|
9
|
-
GEM
|
10
|
-
remote: https://rubygems.org/
|
11
|
-
specs:
|
12
|
-
activemodel (6.0.2.1)
|
13
|
-
activesupport (= 6.0.2.1)
|
14
|
-
activesupport (6.0.2.1)
|
15
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
16
|
-
i18n (>= 0.7, < 2)
|
17
|
-
minitest (~> 5.1)
|
18
|
-
tzinfo (~> 1.1)
|
19
|
-
zeitwerk (~> 2.2)
|
20
|
-
byebug (11.1.1)
|
21
|
-
coderay (1.1.2)
|
22
|
-
concurrent-ruby (1.1.6)
|
23
|
-
diff-lcs (1.3)
|
24
|
-
faraday (1.0.0)
|
25
|
-
multipart-post (>= 1.2, < 3)
|
26
|
-
hashie (3.6.0)
|
27
|
-
i18n (1.8.2)
|
28
|
-
concurrent-ruby (~> 1.0)
|
29
|
-
icalia-sdk-event-core (0.3.3)
|
30
|
-
activemodel (>= 5.0)
|
31
|
-
jsonapi-deserializable (~> 0.2.0)
|
32
|
-
jsonapi-deserializable (0.2.0)
|
33
|
-
jwt (2.2.1)
|
34
|
-
method_source (0.9.2)
|
35
|
-
minitest (5.14.0)
|
36
|
-
multi_json (1.14.1)
|
37
|
-
multi_xml (0.6.0)
|
38
|
-
multipart-post (2.1.1)
|
39
|
-
oauth2 (1.4.3)
|
40
|
-
faraday (>= 0.8, < 2.0)
|
41
|
-
jwt (>= 1.0, < 3.0)
|
42
|
-
multi_json (~> 1.3)
|
43
|
-
multi_xml (~> 0.5)
|
44
|
-
rack (>= 1.2, < 3)
|
45
|
-
omniauth (1.9.0)
|
46
|
-
hashie (>= 3.4.6, < 3.7.0)
|
47
|
-
rack (>= 1.6.2, < 3)
|
48
|
-
omniauth-oauth2 (1.6.0)
|
49
|
-
oauth2 (~> 1.1)
|
50
|
-
omniauth (~> 1.9)
|
51
|
-
pry (0.12.2)
|
52
|
-
coderay (~> 1.1.0)
|
53
|
-
method_source (~> 0.9.0)
|
54
|
-
rack (2.2.2)
|
55
|
-
rake (10.5.0)
|
56
|
-
rspec (3.9.0)
|
57
|
-
rspec-core (~> 3.9.0)
|
58
|
-
rspec-expectations (~> 3.9.0)
|
59
|
-
rspec-mocks (~> 3.9.0)
|
60
|
-
rspec-core (3.9.1)
|
61
|
-
rspec-support (~> 3.9.1)
|
62
|
-
rspec-expectations (3.9.0)
|
63
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
64
|
-
rspec-support (~> 3.9.0)
|
65
|
-
rspec-mocks (3.9.1)
|
66
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
67
|
-
rspec-support (~> 3.9.0)
|
68
|
-
rspec-support (3.9.2)
|
69
|
-
thread_safe (0.3.6)
|
70
|
-
tzinfo (1.2.6)
|
71
|
-
thread_safe (~> 0.1)
|
72
|
-
zeitwerk (2.2.2)
|
73
|
-
|
74
|
-
PLATFORMS
|
75
|
-
ruby
|
76
|
-
|
77
|
-
DEPENDENCIES
|
78
|
-
bundler (~> 1.17)
|
79
|
-
byebug (~> 11.1, >= 11.1)
|
80
|
-
omniauth-icalia!
|
81
|
-
pry (~> 0.12.2)
|
82
|
-
rake (~> 10.0)
|
83
|
-
rspec (~> 3.0)
|
84
|
-
|
85
|
-
BUNDLED WITH
|
86
|
-
1.17.2
|
data/ci-compose.yml
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
# We'll use the '3.x spec since it supports the 'cache_from'
|
2
|
-
# option:
|
3
|
-
version: '3.7'
|
4
|
-
|
5
|
-
services:
|
6
|
-
libraries: &library
|
7
|
-
image: 564922552600.dkr.ecr.eu-central-1.amazonaws.com/icalia-sdk-ruby:testing-${GIT_SHORT_SHA:-latest}
|
8
|
-
build:
|
9
|
-
target: testing
|
10
|
-
context: .
|
11
|
-
cache_from:
|
12
|
-
# Since docker-compose will try to build the unused (at this time) runtime
|
13
|
-
# stage, and this project's dev stages and runtime stages start from
|
14
|
-
# different images, we need to include the releaseable image here as well
|
15
|
-
# - this may change with Docker 19.x:
|
16
|
-
- 564922552600.dkr.ecr.eu-central-1.amazonaws.com/icalia-sdk-ruby:testing-${GIT_SHORT_SHA:-latest}
|
17
|
-
- 564922552600.dkr.ecr.eu-central-1.amazonaws.com/icalia-sdk-ruby:testing-${TAG_SAFE_BRANCH}
|
18
|
-
- 564922552600.dkr.ecr.eu-central-1.amazonaws.com/icalia-sdk-ruby:testing
|
19
|
-
command: bundle exec rake spec
|
20
|
-
volumes:
|
21
|
-
- ${HOME}/.gem/credentials:/root/.gem/credentials
|
22
|
-
|
23
|
-
event_core:
|
24
|
-
<<: *library
|
25
|
-
working_dir: /usr/src/gems/icalia-sdk-event-core
|
26
|
-
|
27
|
-
event_notification:
|
28
|
-
<<: *library
|
29
|
-
working_dir: /usr/src/gems/icalia-sdk-event-notification
|
30
|
-
|
31
|
-
event_webhook:
|
32
|
-
<<: *library
|
33
|
-
working_dir: /usr/src/gems/icalia-sdk-event-webhook
|
34
|
-
|
35
|
-
event_meta:
|
36
|
-
<<: *library
|
37
|
-
working_dir: /usr/src/gems/icalia-sdk-event
|
38
|
-
|
39
|
-
sdk_meta:
|
40
|
-
<<: *library
|
41
|
-
working_dir: /usr/src/gems/icalia-sdk
|
data/docker-compose.yml
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
version: '3.7'
|
2
|
-
|
3
|
-
volumes:
|
4
|
-
lib_gem_bundle:
|
5
|
-
|
6
|
-
services:
|
7
|
-
lib:
|
8
|
-
image: icalialabs/omniauth-icalia:development
|
9
|
-
build:
|
10
|
-
context: .
|
11
|
-
target: development
|
12
|
-
args:
|
13
|
-
DEVELOPER_UID: ${UID:-1000}
|
14
|
-
DEVELOPER_USERNAME: ${USER:-you}
|
15
|
-
command: bundle console
|
16
|
-
volumes:
|
17
|
-
- .:/usr/src
|
18
|
-
- lib_gem_bundle:/usr/local/bundle
|
19
|
-
environment:
|
20
|
-
BUNDLE_CONSOLE: pry
|
@@ -1,109 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
RSpec.describe OmniAuth::Strategies::Icalia do
|
4
|
-
let(:access_token) { instance_double('AccessToken', :options => {}, :[] => 'user') }
|
5
|
-
let(:parsed_response) { instance_double('ParsedResponse') }
|
6
|
-
let(:response) { instance_double('Response', :parsed => parsed_response) }
|
7
|
-
|
8
|
-
let(:example_overridden_site) { 'https://example.com' }
|
9
|
-
let(:example_overridden_token_url) { 'https://example.com/oauth/token' }
|
10
|
-
let(:example_overridden_authorize_url) { 'https://example.com/oauth/authorize' }
|
11
|
-
|
12
|
-
let(:example_options) { {} }
|
13
|
-
|
14
|
-
subject do
|
15
|
-
OmniAuth::Strategies::Icalia.new 'ICALIA_CLIENT_KEY',
|
16
|
-
'ICALIA_CLIENT_SECRET',
|
17
|
-
example_options
|
18
|
-
end
|
19
|
-
|
20
|
-
before :each do
|
21
|
-
allow(subject).to receive(:access_token).and_return(access_token)
|
22
|
-
end
|
23
|
-
|
24
|
-
describe 'client options' do
|
25
|
-
context 'defaults' do
|
26
|
-
it 'site is artanis' do
|
27
|
-
expect(subject.options.client_options.site).to eq 'https://artanis.icalialabs.com'
|
28
|
-
end
|
29
|
-
|
30
|
-
it 'authorize url is artanis authorize url' do
|
31
|
-
expect(subject.options.client_options.authorize_url).to eq 'https://artanis.icalialabs.com/oauth/authorize'
|
32
|
-
end
|
33
|
-
|
34
|
-
it 'token url is artanis token url' do
|
35
|
-
expect(subject.options.client_options.token_url).to eq 'https://artanis.icalialabs.com/oauth/token'
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
context 'overrides' do
|
40
|
-
let :example_options do
|
41
|
-
{
|
42
|
-
client_options: {
|
43
|
-
site: example_overridden_site,
|
44
|
-
token_url: example_overridden_token_url,
|
45
|
-
authorize_url: example_overridden_authorize_url,
|
46
|
-
}
|
47
|
-
}
|
48
|
-
end
|
49
|
-
|
50
|
-
it 'allows overriding the site' do
|
51
|
-
expect(subject.options.client_options.site)
|
52
|
-
.to eq example_overridden_site
|
53
|
-
end
|
54
|
-
|
55
|
-
it 'allows overriding the authorize url' do
|
56
|
-
expect(subject.options.client_options.authorize_url)
|
57
|
-
.to eq example_overridden_authorize_url
|
58
|
-
end
|
59
|
-
|
60
|
-
it 'allows overriding the token url' do
|
61
|
-
expect(subject.options.client_options.token_url)
|
62
|
-
.to eq example_overridden_token_url
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
describe '#raw_info' do
|
68
|
-
it 'should use relative paths' do
|
69
|
-
expect(access_token).to receive(:get).with('/oauth/token/info?include=resource-owner.email-accounts').and_return(response)
|
70
|
-
expect(subject.raw_info).to eq(parsed_response)
|
71
|
-
end
|
72
|
-
|
73
|
-
it 'should use the header auth mode' do
|
74
|
-
expect(access_token).to receive(:get).with('user').and_return(response)
|
75
|
-
subject.raw_info
|
76
|
-
expect(access_token.options[:mode]).to eq(:header)
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
describe '#info.email' do
|
81
|
-
it 'should use any available email' do
|
82
|
-
allow(subject).to receive(:raw_info).and_return({})
|
83
|
-
allow(subject).to receive(:email).and_return('you@example.com')
|
84
|
-
expect(subject.info['email']).to eq('you@example.com')
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
context '#info.urls' do
|
89
|
-
it 'should use html_url from raw_info' do
|
90
|
-
allow(subject).to receive(:raw_info).and_return({ 'login' => 'me', 'html_url' => 'http://enterprise/me' })
|
91
|
-
expect(subject.info['urls']['icalia']).to eq('http://enterprise/me')
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
|
-
context '#extra.scope' do
|
96
|
-
it 'returns the scope on the returned access_token' do
|
97
|
-
expect(subject.scope).to eq('user')
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
describe '#callback_url' do
|
102
|
-
it 'is a combination of host, script name, and callback path' do
|
103
|
-
allow(subject).to receive(:full_host).and_return('https://example.com')
|
104
|
-
allow(subject).to receive(:script_name).and_return('/sub_uri')
|
105
|
-
|
106
|
-
expect(subject.callback_url).to eq('https://example.com/sub_uri/auth/icalia/callback')
|
107
|
-
end
|
108
|
-
end
|
109
|
-
end
|
data/spec/spec_helper.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
require 'bundler/setup'
|
2
|
-
require 'omniauth-icalia'
|
3
|
-
|
4
|
-
RSpec.configure do |config|
|
5
|
-
# Enable flags like --only-failures and --next-failure
|
6
|
-
config.example_status_persistence_file_path = 'examples.txt'
|
7
|
-
|
8
|
-
# Disable RSpec exposing methods globally on `Module` and `main`
|
9
|
-
config.disable_monkey_patching!
|
10
|
-
|
11
|
-
config.expect_with :rspec do |c|
|
12
|
-
c.syntax = :expect
|
13
|
-
end
|
14
|
-
end
|