osso 0.0.5.pre.zeta → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/.buildkite/pipeline.yml +6 -4
  3. data/.github/dependabot.yml +8 -0
  4. data/.github/workflows/automerge.yml +19 -0
  5. data/.rubocop.yml +4 -1
  6. data/Gemfile +2 -2
  7. data/Gemfile.lock +69 -51
  8. data/LICENSE +21 -23
  9. data/Rakefile +2 -0
  10. data/bin/annotate +3 -1
  11. data/db/schema.rb +41 -3
  12. data/lib/osso.rb +0 -1
  13. data/lib/osso/db/migrate/20200929154117_add_users_count_to_identity_providers_and_enterprise_accounts.rb +6 -0
  14. data/lib/osso/db/migrate/20201023142158_add_rodauth_tables.rb +47 -0
  15. data/lib/osso/db/migrate/20201105122026_add_token_index_to_access_tokens.rb +5 -0
  16. data/lib/osso/db/migrate/20201106154936_add_requested_to_authorization_codes_and_access_tokens.rb +6 -0
  17. data/lib/osso/db/migrate/20201109160851_add_sso_issuer_to_identity_providers.rb +12 -0
  18. data/lib/osso/db/migrate/20201110190754_remove_oauth_client_id_from_enterprise_accounts.rb +9 -0
  19. data/lib/osso/db/migrate/20201112160120_add_ping_to_identity_provider_service_enum.rb +28 -0
  20. data/lib/osso/db/migrate/20201125143501_add_salesforce_to_provider_service_enum.rb +28 -0
  21. data/lib/osso/error/account_configuration_error.rb +1 -0
  22. data/lib/osso/error/oauth_error.rb +6 -3
  23. data/lib/osso/graphql/mutation.rb +2 -0
  24. data/lib/osso/graphql/mutations.rb +2 -0
  25. data/lib/osso/graphql/mutations/create_enterprise_account.rb +0 -7
  26. data/lib/osso/graphql/mutations/create_identity_provider.rb +7 -6
  27. data/lib/osso/graphql/mutations/delete_identity_provider.rb +24 -0
  28. data/lib/osso/graphql/mutations/invite_admin_user.rb +43 -0
  29. data/lib/osso/graphql/query.rb +8 -0
  30. data/lib/osso/graphql/resolvers/enterprise_accounts.rb +3 -3
  31. data/lib/osso/graphql/types.rb +2 -2
  32. data/lib/osso/graphql/types/admin_user.rb +9 -0
  33. data/lib/osso/graphql/types/base_object.rb +1 -1
  34. data/lib/osso/graphql/types/enterprise_account.rb +1 -0
  35. data/lib/osso/graphql/types/identity_provider.rb +3 -0
  36. data/lib/osso/graphql/types/identity_provider_service.rb +3 -1
  37. data/lib/osso/lib/app_config.rb +1 -1
  38. data/lib/osso/lib/route_map.rb +0 -15
  39. data/lib/osso/lib/saml_handler.rb +5 -0
  40. data/lib/osso/models/access_token.rb +4 -2
  41. data/lib/osso/models/account.rb +34 -0
  42. data/lib/osso/models/authorization_code.rb +2 -1
  43. data/lib/osso/models/enterprise_account.rb +3 -1
  44. data/lib/osso/models/identity_provider.rb +24 -5
  45. data/lib/osso/models/models.rb +1 -0
  46. data/lib/osso/models/oauth_client.rb +0 -1
  47. data/lib/osso/models/user.rb +2 -2
  48. data/lib/osso/routes/admin.rb +39 -33
  49. data/lib/osso/routes/auth.rb +9 -9
  50. data/lib/osso/routes/oauth.rb +42 -18
  51. data/lib/osso/version.rb +1 -1
  52. data/lib/osso/views/admin.erb +5 -0
  53. data/lib/osso/views/error.erb +1 -0
  54. data/lib/osso/views/layout.erb +0 -0
  55. data/lib/osso/views/multiple_providers.erb +1 -0
  56. data/lib/osso/views/welcome.erb +0 -0
  57. data/lib/tasks/bootstrap.rake +25 -4
  58. data/osso-rb.gemspec +5 -0
  59. data/spec/factories/account.rb +24 -0
  60. data/spec/factories/enterprise_account.rb +11 -3
  61. data/spec/factories/identity_providers.rb +10 -2
  62. data/spec/factories/user.rb +4 -0
  63. data/spec/graphql/mutations/configure_identity_provider_spec.rb +1 -1
  64. data/spec/graphql/mutations/create_enterprise_account_spec.rb +0 -14
  65. data/spec/graphql/mutations/create_identity_provider_spec.rb +59 -8
  66. data/spec/graphql/query/identity_provider_spec.rb +3 -2
  67. data/spec/models/enterprise_account_spec.rb +18 -0
  68. data/spec/models/identity_provider_spec.rb +36 -1
  69. data/spec/routes/admin_spec.rb +7 -41
  70. data/spec/routes/auth_spec.rb +17 -18
  71. data/spec/routes/oauth_spec.rb +102 -5
  72. data/spec/spec_helper.rb +3 -3
  73. data/spec/support/views/hosted_login.erb +1 -0
  74. data/spec/support/views/layout.erb +1 -0
  75. data/spec/support/views/multiple_providers.erb +1 -0
  76. metadata +108 -7
  77. data/lib/osso/helpers/auth.rb +0 -94
  78. data/lib/osso/helpers/helpers.rb +0 -8
  79. data/spec/helpers/auth_spec.rb +0 -97
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eb48ae64d0aa5fb579751215755503e9140506ba9b75b87436fa824d7a2a18f6
4
- data.tar.gz: e9a47f808971ce6e6e36d0f189643fb970e82656507a3de474968e3368e16c29
3
+ metadata.gz: e32f4645ca2763467c9558a6bf103cc5695de99b191e0e2a763e9d1be189e984
4
+ data.tar.gz: ca9c4d902553eee5132fc41c98a458441b20c6aa645bc8a33b48601c80e83392
5
5
  SHA512:
6
- metadata.gz: 49c911667a8eacb8b90958988dd7a8c6625b8d219e6ed24612ac9a6aa5bfe6ee975f8bf0813588379a769d0314d69ee358d3d572a1f6b80ba823dd79b6505047
7
- data.tar.gz: 03bb1c60447df03e088a40e6fbdcabeb14625ec3cd5c8944929cf0626b1e2000a057eb4daa7db77a1a0c4e79fb02c2f3efed61d4be64255a03e3d22b19dfebbe
6
+ metadata.gz: 1c58936f2fa400fb36955405512522bb1fb25ca3c6d8c3436b157d7d915e4db662070b93e1f6f6c7cb523d6f90043426b7bb8b6320967e09aac3be536587c840
7
+ data.tar.gz: '0359da56b5e70537d496a770d6f4e90a1ec248bc786e48b7a7f13dd3860729cb5d1a76de43a9666a486ad4727f3c032c22bdf0a4c0257ee3416d5d41164295c3'
@@ -2,8 +2,10 @@ steps:
2
2
  - name: ":rspec:"
3
3
  commands:
4
4
  - bundle install
5
- - bundle exec rake db:drop
6
- - bundle exec rake db:create
5
+ - dropdb ossorb-development --if-exists
6
+ - dropdb ossorb-test --if-exists
7
+ - createdb ossorb-development
8
+ - createdb ossorb-test
7
9
  - RACK_ENV=test bundle exec rake db:migrate
8
10
  - bundle exec rspec
9
11
  artifact_paths:
@@ -17,8 +19,8 @@ steps:
17
19
  prefix: '/var/lib/buildkite-agent/builds/enterprise-oss-bk-1/enterpriseoss/osso-rb/'
18
20
 
19
21
  - block: ":rubygems: Publish :red_button:"
20
- branches: "main"
22
+ if: build.tag != null
21
23
 
22
24
  - name: "Push :rubygems:"
23
25
  commands: "./bin/publish"
24
- branches: "main"
26
+ if: build.tag != null
@@ -0,0 +1,8 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: bundler
4
+ directory: "/"
5
+ schedule:
6
+ interval: daily
7
+ labels:
8
+ - "dependencies"
@@ -0,0 +1,19 @@
1
+ name: auto-merge
2
+
3
+ on:
4
+ pull_request:
5
+
6
+ jobs:
7
+ auto-approve:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - uses: actions/checkout@v2
11
+ - uses: ahmadnassri/action-dependabot-auto-merge@v2
12
+ with:
13
+ target: minor
14
+ github-token: ${{ secrets.TOKEN }}
15
+ - uses: hmarr/auto-approve-action@v2.0.0
16
+ if: github.actor == 'dependabot[bot]'
17
+ with:
18
+ github-token: "${{ secrets.TOKEN }}"
19
+
@@ -79,4 +79,7 @@ Style/Documentation:
79
79
  Enabled: false
80
80
  Exclude:
81
81
  - 'spec/**/*'
82
- - 'db/**.*'
82
+ - 'db/**.*'
83
+
84
+ Gemspec/RequiredRubyVersion:
85
+ Enabled: false
data/Gemfile CHANGED
@@ -10,10 +10,10 @@ group :test do
10
10
  gem 'faker'
11
11
  gem 'pg'
12
12
  gem 'rack-test'
13
- gem 'rspec', '~> 3.2'
13
+ gem 'rspec', '~> 3.10'
14
14
  gem 'rubocop'
15
15
  gem 'simplecov', '= 0.17', require: false
16
- gem 'webmock', '~> 3.0'
16
+ gem 'webmock', '~> 3.10'
17
17
  end
18
18
 
19
19
  gemspec
@@ -1,16 +1,21 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- osso (0.0.5.pre.zeta)
4
+ osso (0.0.8)
5
5
  activesupport (>= 6.0.3.2)
6
+ bcrypt (~> 3.1.13)
6
7
  graphql
7
8
  jwt
9
+ mail (~> 2.7.1)
8
10
  omniauth-multi-provider
9
11
  omniauth-saml
10
12
  rack (>= 2.1.4)
11
13
  rack-contrib
12
14
  rack-oauth2
13
15
  rake
16
+ rodauth (~> 2.6.0)
17
+ sequel (>= 5.37, < 5.40)
18
+ sequel-activerecord_connection (>= 0.3, < 2.0)
14
19
  sinatra
15
20
  sinatra-activerecord
16
21
  sinatra-contrib
@@ -18,45 +23,47 @@ PATH
18
23
  GEM
19
24
  remote: https://rubygems.org/
20
25
  specs:
21
- activemodel (6.0.3.2)
22
- activesupport (= 6.0.3.2)
23
- activerecord (6.0.3.2)
24
- activemodel (= 6.0.3.2)
25
- activesupport (= 6.0.3.2)
26
- activesupport (6.0.3.2)
26
+ activemodel (6.1.0)
27
+ activesupport (= 6.1.0)
28
+ activerecord (6.1.0)
29
+ activemodel (= 6.1.0)
30
+ activesupport (= 6.1.0)
31
+ activesupport (6.1.0)
27
32
  concurrent-ruby (~> 1.0, >= 1.0.2)
28
- i18n (>= 0.7, < 2)
29
- minitest (~> 5.1)
30
- tzinfo (~> 1.1)
31
- zeitwerk (~> 2.2, >= 2.2.2)
33
+ i18n (>= 1.6, < 2)
34
+ minitest (>= 5.1)
35
+ tzinfo (~> 2.0)
36
+ zeitwerk (~> 2.3)
32
37
  addressable (2.7.0)
33
38
  public_suffix (>= 2.0.2, < 5.0)
34
39
  aes_key_wrap (1.1.0)
40
+ after_commit_everywhere (0.1.5)
41
+ activerecord (>= 4.2)
35
42
  annotate (3.1.1)
36
43
  activerecord (>= 3.2, < 7.0)
37
44
  rake (>= 10.4, < 14.0)
38
45
  ast (2.4.1)
39
46
  attr_required (1.0.1)
47
+ bcrypt (3.1.16)
40
48
  bindata (2.4.8)
41
49
  coderay (1.1.3)
42
- concurrent-ruby (1.1.6)
43
- crack (0.4.3)
44
- safe_yaml (~> 1.0.0)
50
+ concurrent-ruby (1.1.7)
51
+ crack (0.4.4)
45
52
  database_cleaner (1.8.5)
46
53
  database_cleaner-active_record (1.8.0)
47
54
  activerecord
48
55
  database_cleaner (~> 1.8.0)
49
56
  diff-lcs (1.4.4)
50
57
  docile (1.3.2)
51
- factory_bot (6.0.2)
58
+ factory_bot (6.1.0)
52
59
  activesupport (>= 5.0.0)
53
- faker (2.13.0)
60
+ faker (2.15.1)
54
61
  i18n (>= 1.6, < 2)
55
- graphql (1.11.4)
62
+ graphql (1.11.6)
56
63
  hashdiff (1.0.1)
57
64
  hashie (4.1.0)
58
65
  httpclient (2.8.3)
59
- i18n (1.8.3)
66
+ i18n (1.8.5)
60
67
  concurrent-ruby (~> 1.0)
61
68
  json (2.3.1)
62
69
  json-jwt (1.13.0)
@@ -64,9 +71,12 @@ GEM
64
71
  aes_key_wrap
65
72
  bindata
66
73
  jwt (2.2.2)
74
+ mail (2.7.1)
75
+ mini_mime (>= 0.1.1)
67
76
  method_source (1.0.0)
77
+ mini_mime (1.0.2)
68
78
  mini_portile2 (2.4.0)
69
- minitest (5.14.1)
79
+ minitest (5.14.2)
70
80
  multi_json (1.15.0)
71
81
  mustermann (1.1.1)
72
82
  ruby2_keywords (~> 0.0.1)
@@ -77,19 +87,19 @@ GEM
77
87
  rack (>= 1.6.2, < 3)
78
88
  omniauth-multi-provider (0.2.1)
79
89
  omniauth
80
- omniauth-saml (1.10.2)
90
+ omniauth-saml (1.10.3)
81
91
  omniauth (~> 1.3, >= 1.3.2)
82
92
  ruby-saml (~> 1.9)
83
- parallel (1.19.2)
84
- parser (2.7.1.4)
93
+ parallel (1.20.1)
94
+ parser (2.7.2.0)
85
95
  ast (~> 2.4.1)
86
96
  pg (1.2.3)
87
97
  pry (0.13.1)
88
98
  coderay (~> 1.1)
89
99
  method_source (~> 1.0)
90
- public_suffix (4.0.5)
100
+ public_suffix (4.0.6)
91
101
  rack (2.2.3)
92
- rack-contrib (2.2.0)
102
+ rack-contrib (2.3.0)
93
103
  rack (~> 2.0)
94
104
  rack-oauth2 (1.16.0)
95
105
  activesupport
@@ -103,37 +113,46 @@ GEM
103
113
  rack (>= 1.0, < 3)
104
114
  rainbow (3.0.0)
105
115
  rake (13.0.1)
106
- regexp_parser (1.7.1)
116
+ regexp_parser (2.0.0)
107
117
  rexml (3.2.4)
108
- rspec (3.9.0)
109
- rspec-core (~> 3.9.0)
110
- rspec-expectations (~> 3.9.0)
111
- rspec-mocks (~> 3.9.0)
112
- rspec-core (3.9.2)
113
- rspec-support (~> 3.9.3)
114
- rspec-expectations (3.9.2)
118
+ roda (3.38.0)
119
+ rack
120
+ rodauth (2.6.0)
121
+ roda (>= 2.6.0)
122
+ sequel (>= 4)
123
+ rspec (3.10.0)
124
+ rspec-core (~> 3.10.0)
125
+ rspec-expectations (~> 3.10.0)
126
+ rspec-mocks (~> 3.10.0)
127
+ rspec-core (3.10.0)
128
+ rspec-support (~> 3.10.0)
129
+ rspec-expectations (3.10.0)
115
130
  diff-lcs (>= 1.2.0, < 2.0)
116
- rspec-support (~> 3.9.0)
117
- rspec-mocks (3.9.1)
131
+ rspec-support (~> 3.10.0)
132
+ rspec-mocks (3.10.0)
118
133
  diff-lcs (>= 1.2.0, < 2.0)
119
- rspec-support (~> 3.9.0)
120
- rspec-support (3.9.3)
121
- rubocop (0.86.0)
134
+ rspec-support (~> 3.10.0)
135
+ rspec-support (3.10.0)
136
+ rubocop (1.6.1)
122
137
  parallel (~> 1.10)
123
- parser (>= 2.7.0.1)
138
+ parser (>= 2.7.1.5)
124
139
  rainbow (>= 2.2.2, < 4.0)
125
- regexp_parser (>= 1.7)
140
+ regexp_parser (>= 1.8, < 3.0)
126
141
  rexml
127
- rubocop-ast (>= 0.0.3, < 1.0)
142
+ rubocop-ast (>= 1.2.0, < 2.0)
128
143
  ruby-progressbar (~> 1.7)
129
144
  unicode-display_width (>= 1.4.0, < 2.0)
130
- rubocop-ast (0.1.0)
131
- parser (>= 2.7.0.1)
145
+ rubocop-ast (1.3.0)
146
+ parser (>= 2.7.1.5)
132
147
  ruby-progressbar (1.10.1)
133
148
  ruby-saml (1.11.0)
134
149
  nokogiri (>= 1.5.10)
135
150
  ruby2_keywords (0.0.2)
136
- safe_yaml (1.0.5)
151
+ sequel (5.39.0)
152
+ sequel-activerecord_connection (1.2.0)
153
+ activerecord (>= 4.2, < 7)
154
+ after_commit_everywhere (~> 0.1.5)
155
+ sequel (~> 5.16)
137
156
  simplecov (0.17.0)
138
157
  docile (~> 1.1)
139
158
  json (>= 1.8, < 3)
@@ -144,7 +163,7 @@ GEM
144
163
  rack (~> 2.2)
145
164
  rack-protection (= 2.1.0)
146
165
  tilt (~> 2.0)
147
- sinatra-activerecord (2.0.18)
166
+ sinatra-activerecord (2.0.21)
148
167
  activerecord (>= 4.1)
149
168
  sinatra (>= 1.0)
150
169
  sinatra-contrib (2.1.0)
@@ -153,16 +172,15 @@ GEM
153
172
  rack-protection (= 2.1.0)
154
173
  sinatra (= 2.1.0)
155
174
  tilt (~> 2.0)
156
- thread_safe (0.3.6)
157
175
  tilt (2.0.10)
158
- tzinfo (1.2.7)
159
- thread_safe (~> 0.1)
176
+ tzinfo (2.0.3)
177
+ concurrent-ruby (~> 1.0)
160
178
  unicode-display_width (1.7.0)
161
- webmock (3.8.3)
179
+ webmock (3.10.0)
162
180
  addressable (>= 2.3.6)
163
181
  crack (>= 0.3.2)
164
182
  hashdiff (>= 0.4.0, < 2.0.0)
165
- zeitwerk (2.3.1)
183
+ zeitwerk (2.4.2)
166
184
 
167
185
  PLATFORMS
168
186
  ruby
@@ -177,10 +195,10 @@ DEPENDENCIES
177
195
  pg
178
196
  pry
179
197
  rack-test
180
- rspec (~> 3.2)
198
+ rspec (~> 3.10)
181
199
  rubocop
182
200
  simplecov (= 0.17)
183
- webmock (~> 3.0)
201
+ webmock (~> 3.10)
184
202
 
185
203
  BUNDLED WITH
186
204
  2.1.4
data/LICENSE CHANGED
@@ -2,33 +2,31 @@ Business Source License 1.1
2
2
 
3
3
  Parameters
4
4
 
5
- Licensor: Samuel Bauch
5
+ Licensor: EnterpriseOSS, Inc.
6
6
  Licensed Work: osso-rb
7
- The Licensed Work is (c) 2020 Samuel Bauch.
8
- Additional Use Grant: You may make use of the Licensed Work, provided that you do
9
- not use the Licensed Work in a Single Sign On Management
10
- Service.
11
-
12
- A "Single Sign On Management Service" is an offering
13
- (be it free or commercial) that uses the Licensed Work
14
- to allow third parties (other than your employees and
15
- contractors) to access the functionality of the
16
- Licensed Work such that any fourth parties directly
17
- benefit from the authentication, configuration, or
18
- documentation features of the Licensed Work.
19
-
20
- You thus may only use the Licensed Work in a manner
21
- whereby parties who directly benefit from the
22
- authentication, configuration, or documentation features
23
- of the Licensed Work are yourself, your employees or
24
- contractors, and your customers or partners.
25
-
26
- Change Date: 2023-05-01
7
+ The Licensed Work is (c) 2020 EnterpriseOSS, Inc.
8
+
9
+ Additional Use Grant: You and your Authorized Users may make use of the
10
+ Licensed Work for your internal business purposes,
11
+ provided that you do not (i) rent, lease, copy, transfer,
12
+ resell, sublicense, lease, time-share, or otherwise provide
13
+ access to the Licensed Work to a third party (except
14
+ Authorized Users) or (ii) incorporate the Licensed Work
15
+ (or any portion of such) with, or use it with or to provide,
16
+ any site, product, or service, other than on sites/applications
17
+ owned and operated by you.
18
+
19
+ An “Authorized User” is defined as an individual person
20
+ (e.g. your employee, contractor, agent) who is registered and
21
+ permitted by you to use the Licensed Work subject to these
22
+ restrictions.
23
+
24
+ Change Date: 2025-10-01
27
25
 
28
26
  Change License: Apache License, Version 2.0
29
27
 
30
28
  For information about alternative licensing arrangements for the Software,
31
- contact: hello@enterprise-oss.dev
29
+ contact: hello@enterpriseoss.dev
32
30
 
33
31
  Notice
34
32
 
@@ -108,4 +106,4 @@ other recipients of the licensed work to be provided by Licensor:
108
106
 
109
107
  3. To specify a Change Date.
110
108
 
111
- 4. Not to modify this License in any other way.
109
+ 4. Not to modify this License in any other way.
data/Rakefile CHANGED
@@ -4,6 +4,8 @@
4
4
  # to tell ActiveRecord where to find the database
5
5
  # schema and migrations
6
6
 
7
+ ENV['SESSION_SECRET'] ||= 'rake-secret'
8
+
7
9
  require 'bundler/gem_tasks'
8
10
  require 'sinatra/activerecord/rake'
9
11
  require './lib/osso'
@@ -1 +1,3 @@
1
- annotate --require osso.rb --models --model-dir ./lib/osso/models/ --position bottom -k -i
1
+ #!/bin/sh
2
+
3
+ annotate --require osso.rb --models --model-dir=./lib/osso/models/ --position bottom -k -i
@@ -10,9 +10,10 @@
10
10
  #
11
11
  # It's strongly recommended that you check this file into your version control system.
12
12
 
13
- ActiveRecord::Schema.define(version: 2020_09_13_154919) do
13
+ ActiveRecord::Schema.define(version: 2020_11_25_143501) do
14
14
 
15
15
  # These are extensions that must be enabled in order to support this database
16
+ enable_extension "citext"
16
17
  enable_extension "pgcrypto"
17
18
  enable_extension "plpgsql"
18
19
 
@@ -23,10 +24,44 @@ ActiveRecord::Schema.define(version: 2020_09_13_154919) do
23
24
  t.datetime "updated_at", precision: 6, null: false
24
25
  t.uuid "user_id"
25
26
  t.uuid "oauth_client_id"
27
+ t.jsonb "requested", default: {}
26
28
  t.index ["oauth_client_id"], name: "index_access_tokens_on_oauth_client_id"
29
+ t.index ["token", "expires_at"], name: "index_access_tokens_on_token_and_expires_at", unique: true
27
30
  t.index ["user_id"], name: "index_access_tokens_on_user_id"
28
31
  end
29
32
 
33
+ create_table "account_password_hashes", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
34
+ t.string "password_hash", null: false
35
+ end
36
+
37
+ create_table "account_password_reset_keys", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
38
+ t.string "key", null: false
39
+ t.datetime "deadline", null: false
40
+ t.datetime "email_last_sent", default: -> { "CURRENT_TIMESTAMP" }, null: false
41
+ end
42
+
43
+ create_table "account_remember_keys", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
44
+ t.string "key", null: false
45
+ t.datetime "deadline", null: false
46
+ end
47
+
48
+ create_table "account_verification_keys", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
49
+ t.string "key", null: false
50
+ t.datetime "requested_at", default: -> { "CURRENT_TIMESTAMP" }, null: false
51
+ t.datetime "email_last_sent", default: -> { "CURRENT_TIMESTAMP" }, null: false
52
+ t.uuid "account_id"
53
+ t.index ["account_id"], name: "index_account_verification_keys_on_account_id"
54
+ end
55
+
56
+ create_table "accounts", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
57
+ t.citext "email", null: false
58
+ t.integer "status_id", default: 1, null: false
59
+ t.string "role", default: "admin", null: false
60
+ t.string "oauth_client_id"
61
+ t.index ["email"], name: "index_accounts_on_email", unique: true, where: "(status_id = ANY (ARRAY[1, 2]))"
62
+ t.index ["oauth_client_id"], name: "index_accounts_on_oauth_client_id"
63
+ end
64
+
30
65
  create_table "app_configs", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
31
66
  t.string "contact_email"
32
67
  t.string "logo_url"
@@ -43,6 +78,7 @@ ActiveRecord::Schema.define(version: 2020_09_13_154919) do
43
78
  t.datetime "updated_at", precision: 6, null: false
44
79
  t.uuid "user_id"
45
80
  t.uuid "oauth_client_id"
81
+ t.jsonb "requested", default: {}
46
82
  t.index ["oauth_client_id"], name: "index_authorization_codes_on_oauth_client_id"
47
83
  t.index ["token"], name: "index_authorization_codes_on_token", unique: true
48
84
  t.index ["user_id"], name: "index_authorization_codes_on_user_id"
@@ -53,12 +89,11 @@ ActiveRecord::Schema.define(version: 2020_09_13_154919) do
53
89
  t.uuid "external_uuid"
54
90
  t.integer "external_int_id"
55
91
  t.string "external_id"
56
- t.uuid "oauth_client_id"
57
92
  t.string "name", null: false
58
93
  t.datetime "created_at", null: false
59
94
  t.datetime "updated_at", null: false
95
+ t.integer "users_count", default: 0
60
96
  t.index ["domain"], name: "index_enterprise_accounts_on_domain", unique: true
61
- t.index ["oauth_client_id"], name: "index_enterprise_accounts_on_oauth_client_id"
62
97
  end
63
98
 
64
99
  # Could not dump table "identity_providers" because of following StandardError
@@ -94,5 +129,8 @@ ActiveRecord::Schema.define(version: 2020_09_13_154919) do
94
129
  t.index ["enterprise_account_id"], name: "index_users_on_enterprise_account_id"
95
130
  end
96
131
 
132
+ add_foreign_key "account_password_hashes", "accounts", column: "id"
133
+ add_foreign_key "account_password_reset_keys", "accounts", column: "id"
134
+ add_foreign_key "account_remember_keys", "accounts", column: "id"
97
135
  add_foreign_key "users", "identity_providers"
98
136
  end