anoubis 1.0.1 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +10 -0
- data/app/controllers/anoubis/core/data_controller.rb +9 -9
- data/app/controllers/anoubis/core/index/actions.rb +1 -1
- data/app/controllers/anoubis/core/index_controller.rb +3 -3
- data/app/controllers/anoubis/data_controller.rb +5 -0
- data/app/controllers/anoubis/sso/client/data_controller.rb +9 -9
- data/app/controllers/anoubis/sso/client/index_controller.rb +2 -2
- data/app/controllers/anoubis/tenant/data_controller.rb +9 -9
- data/app/controllers/anoubis/tenant/index_controller.rb +3 -3
- data/app/models/anoubis/application_record.rb +81 -0
- data/app/services/anoubis/log_service.rb +97 -0
- data/app/services/anoubis/request_service.rb +134 -0
- data/config/locales/en.yml +20 -6
- data/config/locales/ru.yml +17 -6
- data/config/routes.rb +19 -19
- data/lib/anoubis/version.rb +1 -1
- metadata +24 -6
- 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: c3be94cf75933d32c0e82a7821421ae2f8bcd1a02fbfc151a6d2f3cc789b548e
|
4
|
+
data.tar.gz: bea7c7a2a446f19440de42859a96ac315b80ff080137c5794e8a850d52ee7ab5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51b0569c5df3a41ff856de9f2cd1dd679491d1573a610886e24a8357f9f1d48a702017f5e5e88778d2205bab1100b93740d16e2b8a354aa5d2004df0b9b6c99f
|
7
|
+
data.tar.gz: dd6297cdc5a569fc345fc6e1a125c241a6e6ceb4dfb4d5a2d4c309dd06fe4b27753370176065bf13bd325e899bad2db01cfeec80339a23fd8aba93623c01f701
|
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
|
|
@@ -1,12 +1,12 @@
|
|
1
|
-
require_dependency "
|
2
|
-
require_dependency "
|
3
|
-
require_dependency "
|
4
|
-
require_dependency "
|
5
|
-
require_dependency "
|
6
|
-
require_dependency "
|
7
|
-
require_dependency "
|
8
|
-
require_dependency "
|
9
|
-
require_dependency "
|
1
|
+
require_dependency "anoubis/core/application_controller"
|
2
|
+
require_dependency "anoubis/core/data/actions"
|
3
|
+
require_dependency "anoubis/core/data/load"
|
4
|
+
require_dependency "anoubis/core/data/get"
|
5
|
+
require_dependency "anoubis/core/data/set"
|
6
|
+
require_dependency "anoubis/core/data/setup"
|
7
|
+
require_dependency "anoubis/core/data/defaults"
|
8
|
+
require_dependency "anoubis/core/data/convert"
|
9
|
+
require_dependency "anoubis/core/data/callbacks"
|
10
10
|
|
11
11
|
module Anoubis
|
12
12
|
##
|
@@ -1,6 +1,6 @@
|
|
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
5
|
module Anoubis
|
6
6
|
module Core
|
@@ -1,12 +1,12 @@
|
|
1
|
-
require_dependency "
|
2
|
-
require_dependency "
|
3
|
-
require_dependency "
|
4
|
-
require_dependency "
|
5
|
-
require_dependency "
|
6
|
-
require_dependency "
|
7
|
-
require_dependency "
|
8
|
-
require_dependency "
|
9
|
-
require_dependency "
|
1
|
+
require_dependency "anoubis/sso/client/application_controller"
|
2
|
+
require_dependency "anoubis/sso/client/data/actions"
|
3
|
+
require_dependency "anoubis/sso/client/data/load"
|
4
|
+
require_dependency "anoubis/sso/client/data/get"
|
5
|
+
require_dependency "anoubis/sso/client/data/set"
|
6
|
+
require_dependency "anoubis/sso/client/data/setup"
|
7
|
+
require_dependency "anoubis/sso/client/data/defaults"
|
8
|
+
require_dependency "anoubis/sso/client/data/convert"
|
9
|
+
require_dependency "anoubis/sso/client/data/callbacks"
|
10
10
|
|
11
11
|
# Controller consists all procedures and function for presents and modify models data.
|
12
12
|
class Anoubis::Sso::Client::DataController < Anoubis::Sso::Client::ApplicationController
|
@@ -1,5 +1,5 @@
|
|
1
|
-
require_dependency "
|
2
|
-
require_dependency "
|
1
|
+
require_dependency "anoubis/sso/client/index/actions"
|
2
|
+
require_dependency "anoubis/sso/client/index/callbacks"
|
3
3
|
|
4
4
|
class Anoubis::Sso::Client::IndexController < Anoubis::Sso::Client::ApplicationController
|
5
5
|
include Anoubis::Sso::Client::Index::Actions
|
@@ -1,12 +1,12 @@
|
|
1
|
-
require_dependency "
|
2
|
-
require_dependency "
|
3
|
-
require_dependency "
|
4
|
-
require_dependency "
|
5
|
-
require_dependency "
|
6
|
-
require_dependency "
|
7
|
-
require_dependency "
|
8
|
-
require_dependency "
|
9
|
-
require_dependency "
|
1
|
+
require_dependency "anoubis/tenant/application_controller"
|
2
|
+
require_dependency "anoubis/tenant/data/actions"
|
3
|
+
require_dependency "anoubis/tenant/data/load"
|
4
|
+
require_dependency "anoubis/tenant/data/get"
|
5
|
+
require_dependency "anoubis/tenant/data/set"
|
6
|
+
require_dependency "anoubis/tenant/data/setup"
|
7
|
+
require_dependency "anoubis/tenant/data/defaults"
|
8
|
+
require_dependency "anoubis/tenant/data/convert"
|
9
|
+
require_dependency "anoubis/tenant/data/callbacks"
|
10
10
|
|
11
11
|
module Anoubis
|
12
12
|
##
|
@@ -1,6 +1,6 @@
|
|
1
|
-
require_dependency "
|
2
|
-
require_dependency "
|
3
|
-
require_dependency "
|
1
|
+
require_dependency "anoubis/tenant/application_controller"
|
2
|
+
require_dependency "anoubis/tenant/index/actions"
|
3
|
+
require_dependency "anoubis/tenant/index/callbacks"
|
4
4
|
|
5
5
|
module Anoubis
|
6
6
|
##
|
@@ -42,4 +42,85 @@ class Anoubis::ApplicationRecord < ActiveRecord::Base
|
|
42
42
|
end
|
43
43
|
return value + ':'
|
44
44
|
end
|
45
|
+
|
46
|
+
##
|
47
|
+
# Return defined locale according by I18n
|
48
|
+
# @return [String] current locale
|
49
|
+
def current_locale
|
50
|
+
I18n.locale.to_s
|
51
|
+
end
|
52
|
+
|
53
|
+
##
|
54
|
+
# Returns {current_locale}. If current locale isn't set then returns {default_locale}.
|
55
|
+
# @return [String] current locale
|
56
|
+
def get_locale
|
57
|
+
if current_locale && current_locale != ''
|
58
|
+
return current_locale
|
59
|
+
end
|
60
|
+
|
61
|
+
default_locale
|
62
|
+
end
|
63
|
+
|
64
|
+
##
|
65
|
+
# Default locale that setup in Rails.configuration.i18n.default_locale configuration parameter
|
66
|
+
# @return [String] default locale
|
67
|
+
def default_locale
|
68
|
+
Rails.configuration.i18n.default_locale.to_s
|
69
|
+
end
|
70
|
+
|
71
|
+
##
|
72
|
+
# Returns localized field by identifier
|
73
|
+
# @param field [String] Field identifier
|
74
|
+
# @param used_locale [String | nil] Locale identifier (by default used {current_locale})
|
75
|
+
# @return [String] localized field
|
76
|
+
def get_locale_field(field, used_locale = nil)
|
77
|
+
field = field.to_s.to_sym
|
78
|
+
used_locale = current_locale.to_s unless used_locale
|
79
|
+
|
80
|
+
return '' unless self[field]
|
81
|
+
return self[field][used_locale] if self[field].key? used_locale
|
82
|
+
return '' unless self[field].key? default_locale.to_s
|
83
|
+
|
84
|
+
self[field][default_locale.to_s]
|
85
|
+
end
|
86
|
+
|
87
|
+
##
|
88
|
+
# Sets localized data
|
89
|
+
# @param field [String] field identifier
|
90
|
+
# @param value [String] localized string
|
91
|
+
# @param used_locale [String | nil] Locale identifier (by default used {current_locale})
|
92
|
+
def set_locale_field(field, value, used_locale = nil)
|
93
|
+
field = field.to_s.to_sym
|
94
|
+
used_locale = current_locale.to_s unless used_locale
|
95
|
+
|
96
|
+
self[field] = {} unless self[field]
|
97
|
+
self[field][default_locale.to_s] = value unless self[field].key? default_locale.to_s
|
98
|
+
self[field][used_locale] = value
|
99
|
+
end
|
100
|
+
|
101
|
+
##
|
102
|
+
# Returns true if field has localized data
|
103
|
+
# @param field [String] Field identifier
|
104
|
+
# @param used_locale [String | nil] Locale identifier (by default used {current_locale})
|
105
|
+
# @return [Boolean] true if field has localized data
|
106
|
+
def is_field_localized(field, used_locale = nil)
|
107
|
+
field = field.to_s.to_sym
|
108
|
+
used_locale = current_locale.to_s unless used_locale
|
109
|
+
|
110
|
+
return false unless self[field]
|
111
|
+
return true if self[field].key? used_locale
|
112
|
+
|
113
|
+
false
|
114
|
+
end
|
115
|
+
|
116
|
+
##
|
117
|
+
# Checks if this record may be destroyed.
|
118
|
+
def can_destroy?
|
119
|
+
result = true
|
120
|
+
self.class.reflect_on_all_associations.all? do |assoc|
|
121
|
+
result = self.send(assoc.name).nil? if assoc.macro == :has_one
|
122
|
+
result = self.send(assoc.name).empty? if (assoc.macro == :has_many) && result
|
123
|
+
end
|
124
|
+
result
|
125
|
+
end
|
45
126
|
end
|
@@ -0,0 +1,97 @@
|
|
1
|
+
##
|
2
|
+
# Graylog logging service
|
3
|
+
class Anoubis::LogService
|
4
|
+
# {https://www.rubydoc.info/gems/gelf/GELF/Notifier GELF::Notifier} service
|
5
|
+
attr_accessor :logger
|
6
|
+
# Hash of permanent parameters that added before sending data to Graylog server
|
7
|
+
attr_accessor :perm
|
8
|
+
|
9
|
+
##
|
10
|
+
# Returns Graylog server URL
|
11
|
+
# @return [String] Graylog server URL
|
12
|
+
def url
|
13
|
+
begin
|
14
|
+
value = Rails.configuration.graylog_server
|
15
|
+
rescue StandardError
|
16
|
+
value = '127.0.0.1'
|
17
|
+
end
|
18
|
+
|
19
|
+
value
|
20
|
+
end
|
21
|
+
|
22
|
+
##
|
23
|
+
# Returns Graylog server port
|
24
|
+
# @return [String] Graylog server port
|
25
|
+
def port
|
26
|
+
begin
|
27
|
+
value = Rails.configuration.graylog_port
|
28
|
+
rescue StandardError
|
29
|
+
value = 12201
|
30
|
+
end
|
31
|
+
|
32
|
+
value
|
33
|
+
end
|
34
|
+
|
35
|
+
##
|
36
|
+
# Returns Graylog facility identifier in input source
|
37
|
+
# @return [String] Graylog facility identifier
|
38
|
+
def facility
|
39
|
+
begin
|
40
|
+
value = Rails.configuration.graylog_facility
|
41
|
+
rescue StandardError
|
42
|
+
value = 'Graylog'
|
43
|
+
end
|
44
|
+
|
45
|
+
value
|
46
|
+
end
|
47
|
+
|
48
|
+
##
|
49
|
+
# Setups basic initialization parameters.
|
50
|
+
def initialize
|
51
|
+
self.logger = GELF::Notifier.new(url, port, 'WAN', { facility: facility })
|
52
|
+
logger.collect_file_and_line = false
|
53
|
+
logger.rescue_network_errors = true
|
54
|
+
self.perm = {}
|
55
|
+
end
|
56
|
+
|
57
|
+
##
|
58
|
+
# Send data to Graylog server
|
59
|
+
# @param text [String] Logged text data
|
60
|
+
# @param type [String] Log level ('debug', 'error', 'info', 'warn')
|
61
|
+
# @param object [Hash] Additional parameters for logged data
|
62
|
+
def log(text, type = 'info', object = nil)
|
63
|
+
type = 'info' unless %w[info warn error].include? type.downcase
|
64
|
+
loc = caller_locations(1, 1).first
|
65
|
+
|
66
|
+
data = {
|
67
|
+
short_message: text,
|
68
|
+
level: level(type),
|
69
|
+
line: loc.lineno,
|
70
|
+
file: loc.path
|
71
|
+
}
|
72
|
+
|
73
|
+
data.merge!(object) if object
|
74
|
+
data.merge!(self.perm)
|
75
|
+
logger.notify data
|
76
|
+
nil
|
77
|
+
end
|
78
|
+
|
79
|
+
##
|
80
|
+
# Returns {https://www.rubydoc.info/github/graylog-labs/gelf-rb/GELF/Levels GELF::Levels} according by type
|
81
|
+
# @param type [String] Log level ('debug', 'error', 'info', 'warn')
|
82
|
+
# @return [GELF::Levels] GELF::Levels
|
83
|
+
def level(type)
|
84
|
+
case type
|
85
|
+
when 'debug'
|
86
|
+
return GELF::DEBUG
|
87
|
+
when 'info'
|
88
|
+
return GELF::INFO
|
89
|
+
when 'warn'
|
90
|
+
return GELF::WARN
|
91
|
+
when 'error'
|
92
|
+
return GELF::ERROR
|
93
|
+
end
|
94
|
+
|
95
|
+
GELF::UNKNOWN
|
96
|
+
end
|
97
|
+
end
|
@@ -0,0 +1,134 @@
|
|
1
|
+
##
|
2
|
+
# Request service
|
3
|
+
class Anoubis::RequestService
|
4
|
+
## Redis database variable
|
5
|
+
attr_accessor :redis
|
6
|
+
|
7
|
+
## Returns {https://github.com/redis/redis-rb Redis} prefix for storing cache data
|
8
|
+
attr_accessor :redis_prefix
|
9
|
+
|
10
|
+
## Log service {Anoubis::LogService}
|
11
|
+
attr_accessor :log
|
12
|
+
|
13
|
+
## Cookies data for current session
|
14
|
+
attr_accessor :cookies
|
15
|
+
|
16
|
+
##
|
17
|
+
# Setups basic initialization parameters.
|
18
|
+
# @param log [Anoubis::LogService] Log service
|
19
|
+
def initialize(log = nil)
|
20
|
+
self.redis = Redis.new
|
21
|
+
@cookies = nil
|
22
|
+
self.log = log ? log : Anoubis::LogService.new
|
23
|
+
end
|
24
|
+
|
25
|
+
##
|
26
|
+
# Returns cookies data for current session
|
27
|
+
# @return [Hash] Cookies data
|
28
|
+
def cookies
|
29
|
+
return @cookies if @cookies
|
30
|
+
|
31
|
+
@cookies = redis.get cookie_path
|
32
|
+
if @cookies
|
33
|
+
begin
|
34
|
+
@cookies = JSON.parse(self.cookies, { symbolize_names: true })
|
35
|
+
rescue
|
36
|
+
@cookies = {}
|
37
|
+
end
|
38
|
+
else
|
39
|
+
@cookies = {}
|
40
|
+
end
|
41
|
+
|
42
|
+
@cookies
|
43
|
+
end
|
44
|
+
|
45
|
+
##
|
46
|
+
# Setups cookies data for current session
|
47
|
+
# @param data [Hash] Defined cookies parameters
|
48
|
+
def cookies=(data)
|
49
|
+
@cookies = data
|
50
|
+
store_cookies
|
51
|
+
end
|
52
|
+
|
53
|
+
##
|
54
|
+
# Returns redis path for storing cookies data
|
55
|
+
# @return [String] Redis storing path
|
56
|
+
def cookie_path
|
57
|
+
redis_prefix + 'cookies'
|
58
|
+
end
|
59
|
+
|
60
|
+
##
|
61
|
+
# Store current cookies to {https://github.com/redis/redis-rb Redis} cache
|
62
|
+
def store_cookies
|
63
|
+
redis.set cookie_path, @cookies.to_json
|
64
|
+
end
|
65
|
+
|
66
|
+
##
|
67
|
+
# Unzip {https://www.rubydoc.info/gems/rest-client/RestClient RestClient} response data if returned data is GZipped
|
68
|
+
# @param response [RestClient::RawResponse] Received {https://www.rubydoc.info/gems/rest-client/RestClient/RawResponse RestClient::RawResponse}
|
69
|
+
# @return [String] Unzipped string
|
70
|
+
def unzip(response)
|
71
|
+
result = response.body
|
72
|
+
begin
|
73
|
+
if response.headers.key? :content_encoding
|
74
|
+
if response.headers[:content_encoding] == 'gzip'
|
75
|
+
sio = StringIO.new( response.body )
|
76
|
+
gz = Zlib::GzipReader.new( sio )
|
77
|
+
result = gz.read()
|
78
|
+
end
|
79
|
+
end
|
80
|
+
rescue => e
|
81
|
+
self.log 'Error was received when page encoded. ' + e.to_s, 'debug'
|
82
|
+
result = nil
|
83
|
+
end
|
84
|
+
|
85
|
+
result
|
86
|
+
end
|
87
|
+
|
88
|
+
##
|
89
|
+
# Store data to file
|
90
|
+
# @param file_name [String] Name of file
|
91
|
+
# @param text [String] Saved text
|
92
|
+
def store(file_name, text)
|
93
|
+
file = File.open(file_name, "w")
|
94
|
+
file.write(text)
|
95
|
+
file.close
|
96
|
+
end
|
97
|
+
|
98
|
+
##
|
99
|
+
# Transform cookies string to hash
|
100
|
+
# @param str [String] Cookies string
|
101
|
+
# @return [Hash] Cookies data
|
102
|
+
def parse_cookie(str)
|
103
|
+
cookies = { }
|
104
|
+
|
105
|
+
arr = str.split('; ')
|
106
|
+
arr.each do |line|
|
107
|
+
index = line.index '='
|
108
|
+
if index
|
109
|
+
key = line[0..(index - 1)]
|
110
|
+
value = line[(index + 1)..(line.length - 1)]
|
111
|
+
end
|
112
|
+
cookies[key.to_s.to_sym] = value.to_s
|
113
|
+
end
|
114
|
+
|
115
|
+
cookies
|
116
|
+
end
|
117
|
+
|
118
|
+
##
|
119
|
+
# Returns {https://github.com/redis/redis-rb Redis} prefix for storing cache data. Prefix can be set in Rails.configuration.anoubis_redis_prefix configuration parameter.
|
120
|
+
# @return [String] {https://github.com/redis/redis-rb Redis} prefix
|
121
|
+
def redis_prefix
|
122
|
+
@redis_prefix ||= get_redis_prefix
|
123
|
+
end
|
124
|
+
|
125
|
+
private def get_redis_prefix
|
126
|
+
begin
|
127
|
+
value = Rails.configuration.anoubis_redis_prefix
|
128
|
+
rescue
|
129
|
+
return ''
|
130
|
+
end
|
131
|
+
|
132
|
+
value + ':'
|
133
|
+
end
|
134
|
+
end
|
data/config/locales/en.yml
CHANGED
@@ -30,16 +30,30 @@ en:
|
|
30
30
|
|
31
31
|
|
32
32
|
|
33
|
+
|
34
|
+
|
35
|
+
|
33
36
|
anoubis:
|
34
|
-
all: All
|
35
|
-
success: Successful
|
36
|
-
error: Error
|
37
|
+
all: "All"
|
38
|
+
success: "Successful"
|
39
|
+
error: "Error"
|
40
|
+
errors:
|
41
|
+
incorrect_login: "Incorrect login or password"
|
42
|
+
incorrect_user: "Incorrect user"
|
43
|
+
access_not_allowed: "Access not allowed"
|
44
|
+
session_expired: "Session expired"
|
37
45
|
install:
|
38
46
|
menu:
|
39
47
|
dashboard:
|
40
|
-
title: Dashboard
|
41
|
-
page_title:
|
42
|
-
short_title: Dashboard
|
48
|
+
title: "Dashboard"
|
49
|
+
page_title: "Dashboard"
|
50
|
+
short_title: "Dashboard"
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
|
43
57
|
|
44
58
|
|
45
59
|
|
data/config/locales/ru.yml
CHANGED
@@ -36,15 +36,26 @@ ru:
|
|
36
36
|
|
37
37
|
|
38
38
|
anoubis:
|
39
|
-
all: Все
|
40
|
-
success: Успешное завершение
|
41
|
-
error: Ошибка
|
39
|
+
all: "Все"
|
40
|
+
success: "Успешное завершение"
|
41
|
+
error: "Ошибка"
|
42
|
+
errors:
|
43
|
+
incorrect_login: "Некорректный логин или пароль"
|
44
|
+
session_expired: "Сессия завершена"
|
45
|
+
incorrect_user: "Некорректный пользователь"
|
46
|
+
access_not_allowed: "Доступ запрещен"
|
42
47
|
install:
|
43
48
|
menu:
|
44
49
|
dashboard:
|
45
|
-
title: Дашборд
|
46
|
-
page_title: Дашборд
|
47
|
-
short_title: Дашборд
|
50
|
+
title: "Дашборд"
|
51
|
+
page_title: "Дашборд"
|
52
|
+
short_title: "Дашборд"
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
|
48
59
|
|
49
60
|
|
50
61
|
|
data/config/routes.rb
CHANGED
@@ -8,13 +8,13 @@ Anoubis::Engine.routes.draw do
|
|
8
8
|
|
9
9
|
|
10
10
|
if lib_type == 'tenant'
|
11
|
-
match 'api/:version/*path', { controller: '
|
11
|
+
match 'api/:version/*path', { controller: 'anoubis/tenant/index', action: 'options', constraints: { method: 'OPTIONS' }, via: [:options] }
|
12
12
|
|
13
|
-
post 'api/:version/login', to: '
|
14
|
-
post 'api/:version/validate', to: '
|
15
|
-
post 'api/:version/recover', to: '
|
16
|
-
post 'api/:version/logout', to: '
|
17
|
-
get 'api/:version/menu', to: '
|
13
|
+
post 'api/:version/login', to: 'anoubis/tenant/index#login', :defaults => { :format => 'json' }
|
14
|
+
post 'api/:version/validate', to: 'anoubis/tenant/index#validate', :defaults => { :format => 'json' }
|
15
|
+
post 'api/:version/recover', to: 'anoubis/tenant/index#recover', :defaults => { :format => 'json' }
|
16
|
+
post 'api/:version/logout', to: 'anoubis/tenant/index#logout', :defaults => { :format => 'json' }
|
17
|
+
get 'api/:version/menu', to: 'anoubis/tenant/index#menu', :defaults => { :format => 'json' }
|
18
18
|
|
19
19
|
scope path: 'api', :defaults => { :format => 'json' } do
|
20
20
|
scope path: ':version' do
|
@@ -35,18 +35,18 @@ Anoubis::Engine.routes.draw do
|
|
35
35
|
if lib_type == 'sso-server'
|
36
36
|
scope path: 'api', defaults: { format: 'json' } do
|
37
37
|
scope path: ':version' do
|
38
|
-
match '*path', { controller: '
|
38
|
+
match '*path', { controller: 'anoubis/sso/server/login', action: 'options', constraints: { method: 'OPTIONS' }, via: [:options] }
|
39
39
|
|
40
|
-
get 'login', to: '
|
41
|
-
post 'login', to: '
|
42
|
-
get 'login/:session', to: '
|
43
|
-
put 'login/:session', to: '
|
44
|
-
delete 'login/:session', to: '
|
40
|
+
get 'login', to: 'anoubis/sso/server/login#index'
|
41
|
+
post 'login', to: 'anoubis/sso/server/login#create'
|
42
|
+
get 'login/:session', to: 'anoubis/sso/server/login#show'
|
43
|
+
put 'login/:session', to: 'anoubis/sso/server/login#update'
|
44
|
+
delete 'login/:session', to: 'anoubis/sso/server/login#destroy'
|
45
45
|
|
46
|
-
get 'user/current', to: '
|
47
|
-
get 'user/:uuid', to: '
|
48
|
-
put 'user/current', to: '
|
49
|
-
put 'user/:uuid', to: '
|
46
|
+
get 'user/current', to: 'anoubis/sso/server/user#show_current'
|
47
|
+
get 'user/:uuid', to: 'anoubis/sso/server/user#show'
|
48
|
+
put 'user/current', to: 'anoubis/sso/server/user#update_current'
|
49
|
+
put 'user/:uuid', to: 'anoubis/sso/server/user#update'
|
50
50
|
end
|
51
51
|
end
|
52
52
|
end
|
@@ -54,10 +54,10 @@ Anoubis::Engine.routes.draw do
|
|
54
54
|
if lib_type == 'sso-client'
|
55
55
|
scope path: 'api', defaults: { format: 'json' } do
|
56
56
|
scope path: ':version' do
|
57
|
-
match '*path', { controller: '
|
57
|
+
match '*path', { controller: 'anoubis/sso/server/login', action: 'options', constraints: { method: 'OPTIONS' }, via: [:options] }
|
58
58
|
|
59
|
-
get 'menu', to: '
|
60
|
-
post 'logout', to: '
|
59
|
+
get 'menu', to: 'anoubis/sso/client/index#menu'
|
60
|
+
post 'logout', to: 'anoubis/sso/client/index#logout'
|
61
61
|
#get 'login', to: 'anubis/sso/server/login#index'
|
62
62
|
#post 'login', to: 'anubis/sso/server/login#create'
|
63
63
|
#put 'login/:session', to: 'anubis/sso/server/login#update'
|
data/lib/anoubis/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: anoubis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey Ryabov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 0.5.3
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: gelf
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 3.1.0
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 3.1.0
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: rake
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -147,6 +161,7 @@ files:
|
|
147
161
|
- app/controllers/anoubis/core/index/actions.rb
|
148
162
|
- app/controllers/anoubis/core/index/callbacks.rb
|
149
163
|
- app/controllers/anoubis/core/index_controller.rb
|
164
|
+
- app/controllers/anoubis/data_controller.rb
|
150
165
|
- app/controllers/anoubis/etc.rb
|
151
166
|
- app/controllers/anoubis/etc/base.rb
|
152
167
|
- app/controllers/anoubis/etc/data.rb
|
@@ -196,10 +211,7 @@ files:
|
|
196
211
|
- app/controllers/anoubis/tenant/index/actions.rb
|
197
212
|
- app/controllers/anoubis/tenant/index/callbacks.rb
|
198
213
|
- app/controllers/anoubis/tenant/index_controller.rb
|
199
|
-
- app/controllers/anoubis/tenants_controller.rb
|
200
|
-
- app/controllers/anoubis/users_controller.rb
|
201
214
|
- app/jobs/anoubis/application_job.rb
|
202
|
-
- app/mailers/anoubis/application_mailer.rb
|
203
215
|
- app/models/anoubis/application_record.rb
|
204
216
|
- app/models/anoubis/core/application_record.rb
|
205
217
|
- app/models/anoubis/core/locales.rb
|
@@ -225,6 +237,8 @@ files:
|
|
225
237
|
- app/models/anoubis/tenant/user.rb
|
226
238
|
- app/models/anoubis/tenant/user_group.rb
|
227
239
|
- app/services/anoubis/core_service.rb
|
240
|
+
- app/services/anoubis/log_service.rb
|
241
|
+
- app/services/anoubis/request_service.rb
|
228
242
|
- app/services/anoubis/session_service.rb
|
229
243
|
- app/validators/presence_in_tenant_validator.rb
|
230
244
|
- config/initializers/mime_type.rb
|
@@ -322,7 +336,11 @@ files:
|
|
322
336
|
homepage: https://github.com/RA-Company/
|
323
337
|
licenses:
|
324
338
|
- MIT
|
325
|
-
metadata:
|
339
|
+
metadata:
|
340
|
+
homepage_uri: https://github.com/RA-Company/
|
341
|
+
source_code_uri: https://github.com/RA-Company/anoubis
|
342
|
+
changelog_uri: https://github.com/RA-Company/anoubis/blob/main/CHANGELOG.md
|
343
|
+
documentation_uri: https://www.rubydoc.info/gems/anoubis/1.0.7
|
326
344
|
post_install_message:
|
327
345
|
rdoc_options: []
|
328
346
|
require_paths:
|