anoubis_sso_client 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,28 @@
1
+ ru:
2
+ anoubis:
3
+ install:
4
+ groups:
5
+ admin: "Администраторы"
6
+ user: "Пользователи"
7
+ visitor: "Посетитель"
8
+
9
+ activerecord:
10
+ errors:
11
+ anoubis_sso_client/menu:
12
+ errors:
13
+ has_child_menus: "Содержит вложенные элементы меню"
14
+
15
+ install:
16
+ menu:
17
+ dashboard:
18
+ title: "Дашборд"
19
+ page_title: "Дашборд"
20
+ short_title: "Дашборд"
21
+ settings:
22
+ title: "Настройки"
23
+ page_title: "Настройки"
24
+ short_title: "Настройки"
25
+ settings/menu:
26
+ title: "Меню"
27
+ page_title: "Администрирования меню"
28
+ short_title: "Меню"
data/config/routes.rb ADDED
@@ -0,0 +1,23 @@
1
+ ##
2
+ # Defines default routes
3
+ AnoubisSsoClient::Engine.routes.draw do
4
+ Rails.application.routes.draw do
5
+ scope path: 'api', defaults: { format: 'json' } do
6
+ scope path: ':version' do
7
+ #get 'login', to: 'anoubis_sso_server/main#login', as: 'api_internal_login'
8
+ #get 'auth', to: 'anoubis_sso_server/main#auth', as: 'api_internal_auth'
9
+ #get 'dashboard', to: 'anoubis_sso_server/index#dashboard'
10
+ get 'menu', to: 'anoubis_sso_client/index#menu'
11
+ end
12
+ end
13
+
14
+ scope path: 'openid', defaults: { format: 'json' } do
15
+ #get '.well-known/openid-configuration', to: 'anoubis_sso_server/open_id#configuration', as: 'openid_configuration'
16
+ #get '.well-known/jwks.json', to: 'anoubis_sso_server/open_id#jwks', as: 'openid_jwks'
17
+ #get 'oauth2/auth', to: 'anoubis_sso_server/open_id#auth', as: 'oauth_auth'
18
+ #post 'oauth2/token', to: 'anoubis_sso_server/open_id#access_token', as: 'oauth_token'
19
+ #options 'oauth2/token', to: 'anoubis_sso_server/application#options', as: nil
20
+ #get 'oauth2/logout', to: 'anoubis_sso_server/open_id#logout', as: 'oauth_logout'
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,15 @@
1
+ class CreateAnoubisSsoClientUsers < ActiveRecord::Migration[7.0]
2
+ def change
3
+ create_table :users do |t|
4
+ t.string :uuid, limit: 40, null: false
5
+ t.string :sso_uuid, limit: 40, null: false
6
+ t.string :email, limit: 100, null: true
7
+ t.string :name, limit: 100, null: true
8
+ t.string :surname, limit: 100, null: true
9
+
10
+ t.timestamps
11
+ end
12
+ add_index :users, [:uuid], unique: true
13
+ add_index :users, [:sso_uuid], unique: true
14
+ end
15
+ end
@@ -0,0 +1,11 @@
1
+ class CreateAnoubisSsoClientGroups < ActiveRecord::Migration[7.0]
2
+ def change
3
+ create_table :groups do |t|
4
+ t.string :ident, limit: 50
5
+ t.json :title_locale
6
+
7
+ t.timestamps
8
+ end
9
+ add_index :groups, [:ident], unique: true
10
+ end
11
+ end
@@ -0,0 +1,21 @@
1
+ class CreateAnoubisSsoClientMenus < ActiveRecord::Migration[7.0]
2
+ def change
3
+ create_table :menus do |t|
4
+ t.string :mode, limit: 200
5
+ t.string :action, limit: 50
6
+ t.references :menu, index: true, foreign_key: true
7
+ t.integer :tab, null: false, default: 0
8
+ t.integer :position, null: false, default: 0
9
+ t.integer :page_size, null: false, default: 20
10
+ t.integer :state, null: false, default: 0
11
+ t.integer :status, null: false, default: 0
12
+ t.json :title_locale
13
+ t.json :page_title_locale
14
+ t.json :short_title_locale
15
+
16
+ t.timestamps
17
+ end
18
+ add_index :menus, [:mode], unique: true
19
+ add_index :menus, :tab
20
+ end
21
+ end
@@ -0,0 +1,12 @@
1
+ class CreateAnoubisSsoClientGroupMenus < ActiveRecord::Migration[7.0]
2
+ def change
3
+ create_table :group_menus do |t|
4
+ t.references :group, index: true, foreign_key: true, default: 0
5
+ t.references :menu, index: true, foreign_key: true, default: 0
6
+ t.integer :access, default: 0
7
+
8
+ t.timestamps
9
+ end
10
+ add_index :group_menus, [:group_id, :menu_id], unique: true
11
+ end
12
+ end
@@ -0,0 +1,10 @@
1
+ class CreateAnoubisSsoClientGroupUsers < ActiveRecord::Migration[7.0]
2
+ def change
3
+ create_table :group_users do |t|
4
+ t.references :group, index: true, foreign_key: true, default: 0
5
+ t.references :user, index: true, foreign_key: true, default: 0
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
data/db/seeds.rb ADDED
@@ -0,0 +1,15 @@
1
+ admin_group = AnoubisSsoClient::Group.create_group({ ident: 'admin', translate: 'anoubis.install.groups.admin' })
2
+ user_group = AnoubisSsoClient::Group.create_group({ ident: 'user', translate: 'anoubis.install.groups.user' })
3
+ visitor_group = AnoubisSsoClient::Group.create_group({ ident: 'visitor', translate: 'anoubis.install.groups.visitor' })
4
+
5
+ ## Menu setup
6
+
7
+ ## Dashboard
8
+ menu_0 = AnoubisSsoClient::Menu.create_menu({ mode: 'dashboard', action: 'dashboard', group: [visitor_group, user_group] })
9
+ menu_0.add_group( { group: admin_group, access: 'write' })
10
+
11
+ ## Settings
12
+ menu_0 = AnoubisSsoClient::Menu.create_menu({ mode: 'settings', action: 'menu', group: admin_group, access: 'write' })
13
+
14
+ ## Settings -> Menu
15
+ menu_1 = AnoubisSsoClient::Menu.create_menu({ mode: 'settings/menu', action: 'data', group: admin_group, access: 'write', parent: menu_0 })
@@ -0,0 +1,13 @@
1
+ module AnoubisSsoClient
2
+ ##
3
+ # Main AnoubisSsoServer Engine class
4
+ class Engine < ::Rails::Engine
5
+ isolate_namespace AnoubisSsoClient
6
+ config.generators.api_only = true
7
+
8
+ config.generators do |g|
9
+ g.test_framework :rspec
10
+ g.fixture_replacement :factory_bot, :dir => 'spec/factories'
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,4 @@
1
+ module AnoubisSsoClient
2
+ ## Gem version
3
+ VERSION = "1.0.1"
4
+ end
@@ -0,0 +1,7 @@
1
+ require "anoubis_sso_client/version"
2
+ require "anoubis_sso_client/engine"
3
+
4
+ ## Main module of library for create basic SSO Client based on OAUTH authentication.
5
+ module AnoubisSsoClient
6
+ # Your code goes here...
7
+ end
metadata ADDED
@@ -0,0 +1,240 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: anoubis_sso_client
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Andrey Ryabov
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-05-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 7.0.2.2
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 7.0.2.2
27
+ - !ruby/object:Gem::Dependency
28
+ name: anoubis
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 1.0.2
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 1.0.2
41
+ - !ruby/object:Gem::Dependency
42
+ name: redis
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 4.5.1
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 4.5.1
55
+ - !ruby/object:Gem::Dependency
56
+ name: rest-client
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 2.1.0
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 2.1.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: mysql2
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 0.5.3
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.5.3
83
+ - !ruby/object:Gem::Dependency
84
+ name: jwt
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 2.3.0
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 2.3.0
97
+ - !ruby/object:Gem::Dependency
98
+ name: rake
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '13.0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '13.0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rspec
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 3.11.0
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: 3.11.0
125
+ - !ruby/object:Gem::Dependency
126
+ name: rspec-rails
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '5.1'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '5.1'
139
+ - !ruby/object:Gem::Dependency
140
+ name: factory_bot_rails
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: 6.2.0
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: 6.2.0
153
+ - !ruby/object:Gem::Dependency
154
+ name: dotenv
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '2.7'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '2.7'
167
+ - !ruby/object:Gem::Dependency
168
+ name: rubocop
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '1.25'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '1.25'
181
+ description: Library for create basic SSO Client based on OAUTH authentication.
182
+ email:
183
+ - andrey.ryabov@ra-company.kz
184
+ executables: []
185
+ extensions: []
186
+ extra_rdoc_files: []
187
+ files:
188
+ - MIT-LICENSE
189
+ - README.md
190
+ - Rakefile
191
+ - app/controllers/anoubis_sso_client/application_common.rb
192
+ - app/controllers/anoubis_sso_client/application_controller.rb
193
+ - app/controllers/anoubis_sso_client/data_controller.rb
194
+ - app/controllers/anoubis_sso_client/index_controller.rb
195
+ - app/models/anoubis_sso_client/application_record.rb
196
+ - app/models/anoubis_sso_client/group.rb
197
+ - app/models/anoubis_sso_client/group_menu.rb
198
+ - app/models/anoubis_sso_client/group_user.rb
199
+ - app/models/anoubis_sso_client/menu.rb
200
+ - app/models/anoubis_sso_client/user.rb
201
+ - config/locales/en.yml
202
+ - config/locales/ru.yml
203
+ - config/routes.rb
204
+ - db/migrate/20220302061651_create_anoubis_sso_client_users.rb
205
+ - db/migrate/20220315061539_create_anoubis_sso_client_groups.rb
206
+ - db/migrate/20220413110404_create_anoubis_sso_client_menus.rb
207
+ - db/migrate/20220415131249_create_anoubis_sso_client_group_menus.rb
208
+ - db/migrate/20220420054028_create_anoubis_sso_client_group_users.rb
209
+ - db/seeds.rb
210
+ - lib/anoubis_sso_client.rb
211
+ - lib/anoubis_sso_client/engine.rb
212
+ - lib/anoubis_sso_client/version.rb
213
+ homepage: https://github.com/RA-Company/
214
+ licenses:
215
+ - MIT
216
+ metadata:
217
+ homepage_uri: https://github.com/RA-Company/
218
+ source_code_uri: https://github.com/RA-Company/anoubis_sso_client
219
+ changelog_uri: https://github.com/RA-Company/anoubis_sso_client/blob/main/CHANGELOG.md
220
+ documentation_uri: https://www.rubydoc.info/gems/anoubis_sso_client/1.0.1
221
+ post_install_message:
222
+ rdoc_options: []
223
+ require_paths:
224
+ - lib
225
+ required_ruby_version: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - ">="
228
+ - !ruby/object:Gem::Version
229
+ version: 2.7.1
230
+ required_rubygems_version: !ruby/object:Gem::Requirement
231
+ requirements:
232
+ - - ">="
233
+ - !ruby/object:Gem::Version
234
+ version: '0'
235
+ requirements: []
236
+ rubygems_version: 3.2.3
237
+ signing_key:
238
+ specification_version: 4
239
+ summary: Library for create basic SSO Client based on OAUTH authentication.
240
+ test_files: []