dina 0.5.9.0 → 0.6.0.0
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a04c4026773ff1a9e6b972dde877db7db2ce24f266a6eedec9c557201b913836
|
4
|
+
data.tar.gz: 8482b240897f73716a649e69c7d616cc1be6e66fd2d0f5237d2f4ef71f16af48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ee8a029d86598ae2f8e63afe9713aad2707d19347d3e305c800a93e74a5955adff10a191e37fb5615b75ba994c07d0db72f028b002e35096ed36c4854095dca
|
7
|
+
data.tar.gz: 41640031cd2cebbb32a624866b1cd44ed7fac03b8e4b8854c9a94d1276b5a7f91f70b7d467f696d1034b998330cdeeb8577f33d1c1d5483aee0206096c12faf2
|
@@ -61,6 +61,24 @@ module Dina
|
|
61
61
|
"Bearer " + access_token
|
62
62
|
end
|
63
63
|
|
64
|
+
# Flushes instance variables from memory
|
65
|
+
# but token store file content remains intact
|
66
|
+
def self.flush
|
67
|
+
@token_store_file = nil
|
68
|
+
@user = nil
|
69
|
+
@password = nil
|
70
|
+
@server_name = nil
|
71
|
+
@client_id = nil
|
72
|
+
@endpoint_url = nil
|
73
|
+
Keycloak.auth_server_url = nil
|
74
|
+
Keycloak.realm = nil
|
75
|
+
end
|
76
|
+
|
77
|
+
# Replaces content of token store file with default values
|
78
|
+
def self.flush_token
|
79
|
+
create_empty_token
|
80
|
+
end
|
81
|
+
|
64
82
|
class << self
|
65
83
|
attr_accessor :endpoint_url
|
66
84
|
|
@@ -8,21 +8,28 @@ module Dina
|
|
8
8
|
before_create :on_before_create
|
9
9
|
before_save :on_before_save
|
10
10
|
|
11
|
+
# Required by json_api_client
|
12
|
+
# Set by all child classes
|
11
13
|
def self.endpoint_path
|
12
14
|
end
|
13
15
|
|
16
|
+
# Required by json_api_client
|
14
17
|
def self.site
|
18
|
+
raise ConfigItemMissing, "Missing endpoint_url from config. Perhaps Dina::Authentication.config has not yet been called." unless Dina::Authentication.endpoint_url
|
15
19
|
Dina::Authentication.endpoint_url + "/" + endpoint_path
|
16
20
|
end
|
17
21
|
|
22
|
+
# injects keybloak bearer token with all json_api_client calls
|
18
23
|
def self.custom_headers
|
19
24
|
{ content_type: "application/vnd.api+json", authorization: Dina::Authentication.header }
|
20
25
|
end
|
21
26
|
|
27
|
+
# helper method for all child classes to retrieve records by group
|
22
28
|
def self.find_by_group(group, page: 1, per: 50)
|
23
29
|
self.where("group.groupName": group).page(page).per(per)
|
24
30
|
end
|
25
31
|
|
32
|
+
# helper method to retrieve all properties for a class
|
26
33
|
def self.properties
|
27
34
|
self.schema.instance_values["properties"]
|
28
35
|
end
|
data/lib/dina/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dina
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David P. Shorthouse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-12-
|
11
|
+
date: 2022-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json_api_client
|