Skip to content

Commit ee0013f

Browse files
committed
Merge branch 'develop'
2 parents 7783784 + 4b6b7f4 commit ee0013f

6 files changed

Lines changed: 49 additions & 41 deletions

File tree

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ COPY Gemfile* /srv/ontoportal/ontologies_linked_data/
1414

1515
WORKDIR /srv/ontoportal/ontologies_linked_data
1616

17+
# set rubygem and bundler to the last version supported by ruby 2.7
18+
# remove version after ruby v3 upgrade
19+
RUN gem update --system '3.4.22'
20+
RUN gem install bundler -v 2.4.22
1721
RUN gem update --system
1822
RUN gem install bundler
1923
ENV BUNDLE_PATH=/srv/ontoportal/bundle

Gemfile.lock

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
GIT
22
remote: https://github.com/ncbo/goo.git
3-
revision: 657149d6b33813253fa7440252f69c04e0631190
3+
revision: 75436fe8e387febc53e34ee31ff0e6dd837a9d3f
44
branch: master
55
specs:
66
goo (0.0.2)
@@ -32,12 +32,13 @@ GEM
3232
multi_json (~> 1.3)
3333
thread_safe (~> 0.1)
3434
tzinfo (~> 0.3.37)
35-
addressable (2.8.5)
35+
addressable (2.8.6)
3636
public_suffix (>= 2.0.2, < 6.0)
3737
ansi (1.5.0)
3838
ast (2.4.2)
3939
base64 (0.2.0)
40-
bcrypt (3.1.19)
40+
bcrypt (3.1.20)
41+
bigdecimal (3.1.5)
4142
builder (3.2.4)
4243
coderay (1.1.3)
4344
concurrent-ruby (1.2.2)
@@ -46,14 +47,13 @@ GEM
4647
daemons (1.4.1)
4748
date (3.3.4)
4849
docile (1.4.0)
49-
domain_name (0.5.20190701)
50-
unf (>= 0.0.5, < 1.0.0)
50+
domain_name (0.6.20240107)
5151
email_spec (2.2.2)
5252
htmlentities (~> 4.3.3)
5353
launchy (~> 2.1)
5454
mail (~> 2.7)
5555
eventmachine (1.2.7)
56-
faraday (2.7.11)
56+
faraday (2.8.1)
5757
base64
5858
faraday-net_http (>= 2.0, < 3.1)
5959
ruby2_keywords (>= 0.0.4)
@@ -66,12 +66,12 @@ GEM
6666
domain_name (~> 0.5)
6767
i18n (0.9.5)
6868
concurrent-ruby (~> 1.0)
69-
json (2.6.3)
70-
json_pure (2.6.3)
69+
json (2.7.1)
70+
json_pure (2.7.1)
7171
language_server-protocol (3.17.0.3)
7272
launchy (2.5.2)
7373
addressable (~> 2.8)
74-
libxml-ruby (4.1.2)
74+
libxml-ruby (5.0.2)
7575
logger (1.6.0)
7676
macaddr (1.7.2)
7777
systemu (~> 2.6.5)
@@ -81,9 +81,9 @@ GEM
8181
net-pop
8282
net-smtp
8383
method_source (1.0.0)
84-
mime-types (3.5.1)
84+
mime-types (3.5.2)
8585
mime-types-data (~> 3.2015)
86-
mime-types-data (3.2023.1003)
86+
mime-types-data (3.2023.1205)
8787
mini_mime (1.1.5)
8888
minitest (4.7.5)
8989
minitest-reporters (0.14.24)
@@ -93,21 +93,22 @@ GEM
9393
powerbar
9494
multi_json (1.15.0)
9595
net-http-persistent (2.9.4)
96-
net-imap (0.4.4)
96+
net-imap (0.4.9.1)
9797
date
9898
net-protocol
9999
net-pop (0.1.2)
100100
net-protocol
101101
net-protocol (0.2.2)
102102
timeout
103-
net-smtp (0.4.0)
103+
net-smtp (0.4.0.1)
104104
net-protocol
105105
netrc (0.11.0)
106-
oj (3.16.1)
106+
oj (3.16.3)
107+
bigdecimal (>= 3.0)
107108
omni_logger (0.1.4)
108109
logger
109-
parallel (1.23.0)
110-
parser (3.2.2.4)
110+
parallel (1.24.0)
111+
parser (3.3.0.3)
111112
ast (~> 2.4.1)
112113
racc
113114
pony (1.13.1)
@@ -117,7 +118,7 @@ GEM
117118
pry (0.14.2)
118119
coderay (~> 1.1)
119120
method_source (~> 1.0)
120-
public_suffix (5.0.3)
121+
public_suffix (5.0.4)
121122
racc (1.7.3)
122123
rack (2.2.8)
123124
rack-test (0.8.3)
@@ -128,9 +129,9 @@ GEM
128129
addressable (>= 2.2)
129130
redis (5.0.8)
130131
redis-client (>= 0.17.0)
131-
redis-client (0.18.0)
132+
redis-client (0.19.1)
132133
connection_pool
133-
regexp_parser (2.8.2)
134+
regexp_parser (2.9.0)
134135
rest-client (2.1.0)
135136
http-accept (>= 1.7.0, < 2.0)
136137
http-cookie (>= 1.0.2, < 2.0)
@@ -140,15 +141,15 @@ GEM
140141
rsolr (2.5.0)
141142
builder (>= 2.1.2)
142143
faraday (>= 0.9, < 3, != 2.0.0)
143-
rubocop (1.57.2)
144+
rubocop (1.59.0)
144145
json (~> 2.3)
145146
language_server-protocol (>= 3.17.0)
146147
parallel (~> 1.10)
147148
parser (>= 3.2.2.4)
148149
rainbow (>= 2.2.2, < 4.0)
149150
regexp_parser (>= 1.8, < 3.0)
150151
rexml (>= 3.2.5, < 4.0)
151-
rubocop-ast (>= 1.28.1, < 2.0)
152+
rubocop-ast (>= 1.30.0, < 2.0)
152153
ruby-progressbar (~> 1.7)
153154
unicode-display_width (>= 2.4.0, < 3.0)
154155
rubocop-ast (1.30.0)
@@ -173,17 +174,13 @@ GEM
173174
thread_safe (0.3.6)
174175
timeout (0.4.1)
175176
tzinfo (0.3.62)
176-
unf (0.1.4)
177-
unf_ext
178-
unf_ext (0.0.8.2)
179177
unicode-display_width (2.5.0)
180178
uuid (2.3.9)
181179
macaddr (~> 1.0)
182180

183181
PLATFORMS
184182
aarch64-linux
185183
arm64-darwin-22
186-
x86_64-darwin-21
187184
x86_64-linux
188185

189186
DEPENDENCIES
@@ -215,4 +212,4 @@ DEPENDENCIES
215212
thin
216213

217214
BUNDLED WITH
218-
2.3.15
215+
2.3.22

docker-compose.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,7 @@ services:
117117
retries: 5
118118

119119
agraph-ut:
120-
# image: franzinc/agraph:v7.3.1
121-
image: ontoportal/agraph:v7.3.1-patch1 #in place untill agraph v7.4.0 is released
120+
image: franzinc/agraph:v8.0.0
122121
platform: linux/amd64
123122
environment:
124123
- AGRAPH_SUPER_USER=test

lib/ontologies_linked_data/models/ontology_submission.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,11 @@ def valid?
147147
return valid_result && sc
148148
end
149149

150+
def remote_pulled?
151+
self.bring(:pullLocation) if self.bring?(:pullLocation)
152+
self.pullLocation != nil
153+
end
154+
150155
def sanity_check
151156
self.bring(:ontology) if self.bring?(:ontology)
152157
self.ontology.bring(:summaryOnly) if self.ontology.bring?(:summaryOnly)

lib/ontologies_linked_data/security/authorization.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ def find_apikey(env, params)
7878
apikey = params["apikey"]
7979
elsif apikey.nil? && header_auth
8080
token = Rack::Utils.parse_query(header_auth.split(" ")[1])
81+
return unless token["token"]
82+
8183
# Strip spaces from start and end of string
8284
apikey = token["token"].gsub(/\"/, "")
8385
# If the user apikey is passed, use that instead

test/rack/test_request_authorization.rb

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,31 +60,32 @@ def _delete_user
6060

6161
def test_authorize
6262
get "/ontologies"
63-
assert last_response.status == 401
63+
assert_equal 401, last_response.status
64+
get "/ontologies", {}, {"Authorization" => "bogus auth header"}
65+
assert_equal 401, last_response.status
6466
get "/ontologies", {}, {"Authorization" => 'apikey token="'+@apikey+''+'"'}
65-
assert last_response.status == 200
67+
assert_equal 200, last_response.status
6668
apikey = MultiJson.load(last_response.body)
6769
assert @apikey.eql?(apikey)
6870
get "/ontologies", {}, {"Authorization" => "apikey token=#{@apikey}"}
69-
assert last_response.status == 200
71+
assert_equal 200, last_response.status
7072
apikey = MultiJson.load(last_response.body)
71-
assert @apikey.eql?(apikey)
73+
assert_equal @apikey, apikey
7274
get "/ontologies?apikey=#{@apikey}"
73-
assert last_response.status == 200
75+
assert_equal 200, last_response.status
7476
apikey = MultiJson.load(last_response.body)
75-
assert @apikey.eql?(apikey)
77+
assert_equal @apikey, apikey
7678
get "/ontologies", {}, {"Authorization" => 'apikey token="'+@apikey+'&userapikey='+@userapikey+'"'}
77-
assert last_response.status == 200
79+
assert_equal 200, last_response.status
7880
apikey = MultiJson.load(last_response.body)
79-
assert @userapikey.eql?(apikey)
81+
assert_equal @userapikey, apikey
8082
get "/ontologies", {}, {"Authorization" => "apikey token=#{@apikey}&userapikey=#{@userapikey}"}
81-
assert last_response.status == 200
83+
assert_equal 200, last_response.status
8284
apikey = MultiJson.load(last_response.body)
83-
assert @userapikey.eql?(apikey)
85+
assert_equal @userapikey, apikey
8486
get "/ontologies?apikey=#{@apikey}&userapikey=#{@userapikey}"
85-
assert last_response.status == 200
87+
assert_equal 200, last_response.status
8688
apikey = MultiJson.load(last_response.body)
87-
assert @userapikey.eql?(apikey)
89+
assert_equal @userapikey, apikey
8890
end
89-
9091
end

0 commit comments

Comments
 (0)