decidim-bulletin_board 0.10.1 → 0.13.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +45 -0
- data/Gemfile.lock +56 -56
- data/app/assets/javascripts/decidim/bulletin_board/decidim-bulletin_board.js +6 -6
- data/bin/release +1 -1
- data/lib/decidim/bulletin_board.rb +5 -5
- data/lib/decidim/bulletin_board/authority/create_election.rb +12 -13
- data/lib/decidim/bulletin_board/authority/get_election_results.rb +1 -1
- data/lib/decidim/bulletin_board/client.rb +4 -1
- data/lib/decidim/bulletin_board/command.rb +1 -1
- data/lib/decidim/bulletin_board/graphql/bb_schema.json +3 -7
- data/lib/decidim/bulletin_board/graphql/factory.rb +2 -2
- data/lib/decidim/bulletin_board/message_identifier.rb +7 -3
- data/lib/decidim/bulletin_board/settings.rb +14 -22
- data/lib/decidim/bulletin_board/version.rb +1 -1
- metadata +2 -2
@@ -5,45 +5,37 @@ module Decidim
|
|
5
5
|
# The Bulletin Board settings class
|
6
6
|
class Settings
|
7
7
|
def initialize(config)
|
8
|
-
@
|
9
|
-
@
|
10
|
-
@api_key = config.api_key.presence
|
8
|
+
@bulletin_board_server = config.bulletin_board_server.presence
|
9
|
+
@bulletin_board_public_key = config.bulletin_board_public_key.presence
|
11
10
|
|
11
|
+
@authority_api_key = config.authority_api_key.presence
|
12
12
|
@authority_name = config.authority_name.presence
|
13
|
-
@
|
13
|
+
@authority_private_key = JwkUtils.import_private_key(config.authority_private_key) if config.authority_private_key.present?
|
14
14
|
|
15
15
|
@scheme_name = config.scheme_name.presence
|
16
16
|
@number_of_trustees = config.number_of_trustees.presence
|
17
17
|
@quorum = config.quorum.presence || number_of_trustees
|
18
18
|
end
|
19
19
|
|
20
|
-
attr_reader :server, :server_public_key, :api_key, :authority_name, :scheme_name, :number_of_trustees, :quorum
|
21
|
-
|
22
20
|
def configured?
|
23
|
-
|
24
|
-
end
|
25
|
-
|
26
|
-
def authority_slug
|
27
|
-
@authority_slug ||= authority_name.parameterize
|
21
|
+
bulletin_board_server && bulletin_board_public_key && authority_api_key && authority_name && authority_private_key && scheme_name && number_of_trustees
|
28
22
|
end
|
29
23
|
|
30
|
-
|
31
|
-
|
24
|
+
attr_reader :bulletin_board_server, :bulletin_board_public_key,
|
25
|
+
:authority_private_key, :authority_api_key, :authority_name,
|
26
|
+
:scheme_name, :number_of_trustees, :quorum
|
32
27
|
|
33
|
-
|
28
|
+
def bulletin_board_public_key_rsa
|
29
|
+
@bulletin_board_public_key_rsa ||= JWT::JWK::RSA.import(bulletin_board_public_key).public_key
|
34
30
|
end
|
35
31
|
|
36
|
-
def
|
37
|
-
@
|
32
|
+
def authority_slug
|
33
|
+
@authority_slug ||= authority_name.parameterize
|
38
34
|
end
|
39
35
|
|
40
|
-
def
|
41
|
-
@
|
36
|
+
def authority_public_key
|
37
|
+
@authority_public_key ||= authority_private_key&.export
|
42
38
|
end
|
43
|
-
|
44
|
-
private
|
45
|
-
|
46
|
-
attr_reader :identification_private_key
|
47
39
|
end
|
48
40
|
end
|
49
41
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-bulletin_board
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Morcillo
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: exe
|
13
13
|
cert_chain: []
|
14
|
-
date: 2021-02-
|
14
|
+
date: 2021-02-25 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rails
|