anoubis 1.0.0 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -0
- data/app/controllers/anoubis/application_controller.rb +22 -6
- data/app/controllers/anoubis/core/application_controller.rb +6 -6
- data/app/controllers/anoubis/core/index/actions.rb +3 -3
- data/app/controllers/anoubis/core/index/callbacks.rb +1 -1
- data/app/controllers/anoubis/core/index_controller.rb +7 -7
- data/app/controllers/anoubis/data/actions.rb +956 -0
- data/app/controllers/anoubis/data/callbacks.rb +66 -0
- data/app/controllers/anoubis/data/convert.rb +405 -0
- data/app/controllers/anoubis/data/defaults.rb +215 -0
- data/app/controllers/anoubis/data/get.rb +529 -0
- data/app/controllers/anoubis/data/load.rb +87 -0
- data/app/controllers/anoubis/data/set.rb +47 -0
- data/app/controllers/anoubis/data/setup.rb +102 -0
- data/app/controllers/anoubis/data_controller.rb +21 -0
- data/app/controllers/anoubis/etc/base.rb +16 -11
- data/app/controllers/anoubis/etc/data.rb +1 -1
- data/app/controllers/anoubis/etc/field.rb +10 -10
- data/app/controllers/anoubis/etc/field_options.rb +1 -1
- data/app/controllers/anoubis/etc/field_order.rb +1 -1
- data/app/controllers/anoubis/etc/filter.rb +2 -2
- data/app/controllers/anoubis/etc/menu.rb +2 -2
- data/app/controllers/anoubis/etc/model.rb +1 -1
- data/app/controllers/anoubis/etc/tab_item.rb +1 -1
- data/app/controllers/anoubis/etc.rb +1 -1
- data/app/controllers/anoubis/export.rb +1 -1
- data/app/controllers/anoubis/output/autocomplete.rb +1 -1
- data/app/controllers/anoubis/output/basic.rb +2 -2
- data/app/controllers/anoubis/output/data.rb +1 -1
- data/app/controllers/anoubis/output/delete.rb +1 -1
- data/app/controllers/anoubis/output/edit.rb +1 -1
- data/app/controllers/anoubis/output/frame.rb +5 -5
- data/app/controllers/anoubis/output/login.rb +1 -1
- data/app/controllers/anoubis/output/menu.rb +3 -3
- data/app/controllers/anoubis/output/update.rb +1 -1
- data/app/controllers/anoubis/sso/client/application_controller.rb +2 -2
- data/app/controllers/anoubis/sso/client/index/actions.rb +6 -6
- data/app/controllers/anoubis/sso/client/index/callbacks.rb +1 -1
- data/app/controllers/anoubis/sso/client/index_controller.rb +5 -5
- data/app/controllers/anoubis/sso/server/application_controller.rb +2 -2
- data/app/controllers/anoubis/sso/server/login_controller.rb +6 -6
- data/app/controllers/anoubis/sso/server/user_controller.rb +3 -3
- data/app/controllers/anoubis/tenant/application_controller.rb +4 -4
- data/app/controllers/anoubis/tenant/index/actions.rb +15 -15
- data/app/controllers/anoubis/tenant/index/callbacks.rb +2 -2
- data/app/controllers/anoubis/tenant/index_controller.rb +7 -7
- data/app/models/anoubis/application_record.rb +90 -2
- data/app/models/anoubis/core/application_record.rb +3 -3
- data/app/models/anoubis/sso/client/group_menu.rb +6 -6
- data/app/models/anoubis/sso/client/menu.rb +8 -8
- data/app/models/anoubis/sso/client/user.rb +3 -3
- data/app/models/anoubis/sso/server/user.rb +1 -1
- data/app/models/anoubis/tenant/group_menu.rb +5 -5
- data/app/models/anoubis/tenant/menu.rb +13 -13
- data/app/models/anoubis/tenant/system.rb +5 -5
- data/app/models/anoubis/tenant/user.rb +4 -4
- data/app/services/anoubis/log_service.rb +97 -0
- data/app/services/anoubis/request_service.rb +134 -0
- data/app/services/anoubis/session_service.rb +1 -1
- data/config/locales/en.yml +31 -2
- data/config/locales/ru.yml +32 -5
- data/config/routes.rb +19 -19
- data/db/seeds.rb +30 -30
- data/lib/anoubis/version.rb +1 -1
- data/lib/anoubis.rb +1 -1
- data/spec/controllers/anoubis/index_controller_spec.rb +1 -1
- data/spec/dummy/log/development.log +0 -0
- data/spec/dummy/log/test.log +0 -0
- data/spec/dummy/tmp/development_secret.txt +1 -0
- data/spec/models/anoubis/group_locale_spec.rb +1 -1
- data/spec/models/anoubis/group_menu_spec.rb +6 -6
- data/spec/models/anoubis/group_spec.rb +3 -3
- data/spec/models/anoubis/menu_locale_spec.rb +1 -1
- data/spec/models/anoubis/menu_spec.rb +1 -1
- data/spec/models/anoubis/system_locale_spec.rb +1 -1
- data/spec/models/anoubis/system_menu_spec.rb +5 -5
- data/spec/models/anoubis/system_spec.rb +4 -4
- data/spec/models/anoubis/tenant_spec.rb +4 -4
- data/spec/models/anoubis/user_spec.rb +2 -2
- metadata +92 -87
- data/app/controllers/anoubis/core/data/actions.rb +0 -962
- data/app/controllers/anoubis/core/data/callbacks.rb +0 -68
- data/app/controllers/anoubis/core/data/convert.rb +0 -407
- data/app/controllers/anoubis/core/data/defaults.rb +0 -217
- data/app/controllers/anoubis/core/data/get.rb +0 -531
- data/app/controllers/anoubis/core/data/load.rb +0 -89
- data/app/controllers/anoubis/core/data/set.rb +0 -49
- data/app/controllers/anoubis/core/data/setup.rb +0 -104
- data/app/controllers/anoubis/core/data_controller.rb +0 -28
- data/app/controllers/anoubis/sso/client/data/actions.rb +0 -5
- data/app/controllers/anoubis/sso/client/data/callbacks.rb +0 -5
- data/app/controllers/anoubis/sso/client/data/convert.rb +0 -5
- data/app/controllers/anoubis/sso/client/data/defaults.rb +0 -5
- data/app/controllers/anoubis/sso/client/data/get.rb +0 -5
- data/app/controllers/anoubis/sso/client/data/load.rb +0 -26
- data/app/controllers/anoubis/sso/client/data/set.rb +0 -5
- data/app/controllers/anoubis/sso/client/data/setup.rb +0 -5
- data/app/controllers/anoubis/sso/client/data_controller.rb +0 -21
- data/app/controllers/anoubis/tenant/data/actions.rb +0 -11
- data/app/controllers/anoubis/tenant/data/callbacks.rb +0 -11
- data/app/controllers/anoubis/tenant/data/convert.rb +0 -11
- data/app/controllers/anoubis/tenant/data/defaults.rb +0 -11
- data/app/controllers/anoubis/tenant/data/get.rb +0 -11
- data/app/controllers/anoubis/tenant/data/load.rb +0 -52
- data/app/controllers/anoubis/tenant/data/set.rb +0 -11
- data/app/controllers/anoubis/tenant/data/setup.rb +0 -11
- data/app/controllers/anoubis/tenant/data_controller.rb +0 -28
- data/app/controllers/anoubis/tenants_controller.rb +0 -7
- data/app/controllers/anoubis/users_controller.rb +0 -7
- data/app/mailers/anoubis/application_mailer.rb +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5464dccc282a05f485f875d7961916178f580dfb96957bde888ab61ec73f7276
|
4
|
+
data.tar.gz: 8cc6edd51976891558a02532f13b2d8613763f0f50075b2dcaa642f18707f268
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ff86708955579d2f88fa8f6492b7c9dc59f6d33e15e290578f046547bd921eb92dea83f0a16f3e97a6144e6c5f0775dc27bc478f1deb33441c140da4f5903a7
|
7
|
+
data.tar.gz: 32e3ce400a9838b7785a0fea0ba6f60e884c25dc4ece6d8e15a5ae940c05c4e6cb79931a0fc6f68dc47597655da1aa6d431eeff067218ff4db1488800a7afb77
|
data/README.md
CHANGED
@@ -21,6 +21,16 @@ Or install it yourself as:
|
|
21
21
|
$ gem install anoubis
|
22
22
|
```
|
23
23
|
|
24
|
+
## Configuration parameters
|
25
|
+
|
26
|
+
This configuration parameters can be placed at files config/application.rb for global configuration or config/environments/<environment>.rb for custom environment configuration.
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
config.graylog_server = '127.0.0.1' # Graylog server (By default set as '127.0.0.1') (*optional)
|
30
|
+
config.graylog_port = 12201 # Graylog server port (By default set as 12201) (*optional)
|
31
|
+
config.graylog_facility = 'Graylog' # Graylog source identifier (By default set as 'Graylog') (*optional)
|
32
|
+
```
|
33
|
+
|
24
34
|
## Contributing
|
25
35
|
Contribution directions go here.
|
26
36
|
|
@@ -10,6 +10,10 @@ class Anoubis::ApplicationController < ActionController::API
|
|
10
10
|
## Current used locale
|
11
11
|
attr_accessor :locale
|
12
12
|
|
13
|
+
# @!attribute [rw] output
|
14
|
+
# @return [Anoubis::Output] standard output.
|
15
|
+
attr_accessor :output
|
16
|
+
|
13
17
|
##
|
14
18
|
# Returns default locale initialized in application configuration file. Variable is taken from {https://guides.rubyonrails.org/i18n.html Rails.configuration.i18n.default_locale} parameter
|
15
19
|
# @return [String] default locale
|
@@ -55,18 +59,30 @@ class Anoubis::ApplicationController < ActionController::API
|
|
55
59
|
rescue
|
56
60
|
I18n.locale = default_locale
|
57
61
|
end
|
62
|
+
|
63
|
+
after_anoubis_initialization
|
64
|
+
end
|
65
|
+
|
66
|
+
##
|
67
|
+
# Procedure fires after initializes all parameters
|
68
|
+
def after_anoubis_initialization
|
69
|
+
|
58
70
|
end
|
59
71
|
|
60
72
|
##
|
61
73
|
# Generates options headers for CORS requests
|
62
74
|
# @param methods [String] list of allowed HTTP actions separated by space <i>(e.g. 'GET POST DELETE')</i>
|
63
75
|
def options(methods = 'POST')
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
76
|
+
return unless check_origin
|
77
|
+
return unless request.origin
|
78
|
+
|
79
|
+
headers['Access-Control-Allow-Origin'] = request.headers['origin']
|
80
|
+
headers['Access-Control-Allow-Methods'] = methods
|
81
|
+
|
82
|
+
return if request.method != 'OPTIONS'
|
83
|
+
|
84
|
+
headers['Access-Control-Max-Age'] = '1000'
|
85
|
+
headers['Access-Control-Allow-Headers'] = '*,x-requested-with,Content-Type,Authorization'
|
70
86
|
end
|
71
87
|
|
72
88
|
##
|
@@ -1,6 +1,6 @@
|
|
1
1
|
##
|
2
2
|
# Application controller for Anubis library.
|
3
|
-
class
|
3
|
+
class Anoubis::Core::ApplicationController < ActionController::API
|
4
4
|
prepend_before_action :anubis_core_initialization
|
5
5
|
|
6
6
|
#include AbstractController::Translation
|
@@ -23,7 +23,7 @@ class Anubis::Core::ApplicationController < ActionController::API
|
|
23
23
|
attr_accessor :current_user
|
24
24
|
|
25
25
|
# @!attribute [rw] output
|
26
|
-
# @return [
|
26
|
+
# @return [Anoubis::Output] standard output.
|
27
27
|
attr_accessor :output
|
28
28
|
|
29
29
|
# @!attribute [rw] writer
|
@@ -31,11 +31,11 @@ class Anubis::Core::ApplicationController < ActionController::API
|
|
31
31
|
attr_accessor :writer
|
32
32
|
|
33
33
|
# @!attribute [rw] etc
|
34
|
-
# @return [
|
34
|
+
# @return [Anoubis::Etc::Base] global system parameters
|
35
35
|
attr_accessor :etc
|
36
36
|
|
37
37
|
# @!attribute [rw] exports
|
38
|
-
# @return [
|
38
|
+
# @return [Anoubis::Export] Export data class
|
39
39
|
attr_accessor :exports
|
40
40
|
|
41
41
|
##
|
@@ -50,9 +50,9 @@ class Anubis::Core::ApplicationController < ActionController::API
|
|
50
50
|
self.version = 0
|
51
51
|
|
52
52
|
if defined? params
|
53
|
-
self.etc =
|
53
|
+
self.etc = Anoubis::Etc::Base.new({ params: params })
|
54
54
|
else
|
55
|
-
self.etc =
|
55
|
+
self.etc = Anoubis::Etc::Base.new
|
56
56
|
end
|
57
57
|
self.output = nil
|
58
58
|
self.exports = nil
|
@@ -1,6 +1,6 @@
|
|
1
|
-
require_dependency "
|
1
|
+
require_dependency "anoubis/output/login"
|
2
2
|
|
3
|
-
module
|
3
|
+
module Anoubis
|
4
4
|
module Core
|
5
5
|
##
|
6
6
|
# Module contains all procedures and function for {IndexController}. Consists of {Actions} and {Callbacks} module.
|
@@ -39,7 +39,7 @@ module Anubis
|
|
39
39
|
# "message": "Session expired"
|
40
40
|
# }
|
41
41
|
def logout
|
42
|
-
self.output =
|
42
|
+
self.output = Anoubis::Output::Basic.new
|
43
43
|
self.redis.del(self.redis_prefix + 'ses_'+self.token)
|
44
44
|
respond_to do |format|
|
45
45
|
format.json { render json: self.output.to_h }
|
@@ -1,14 +1,14 @@
|
|
1
|
-
require_dependency "
|
2
|
-
require_dependency "
|
3
|
-
require_dependency "
|
1
|
+
require_dependency "anoubis/core/application_controller"
|
2
|
+
require_dependency "anoubis/core/index/actions"
|
3
|
+
require_dependency "anoubis/core/index/callbacks"
|
4
4
|
|
5
|
-
module
|
5
|
+
module Anoubis
|
6
6
|
module Core
|
7
7
|
##
|
8
8
|
# Controller processes main system functions. Authenticates user, checks user access, outputs main menu and etc.
|
9
|
-
class IndexController <
|
10
|
-
include
|
11
|
-
include
|
9
|
+
class IndexController < Anoubis::Core::ApplicationController
|
10
|
+
include Anoubis::Core::Index::Actions
|
11
|
+
include Anoubis::Core::Index::Callbacks
|
12
12
|
|
13
13
|
##
|
14
14
|
# Check if authentication required
|