Skip to content

Commit

Permalink
remove automatic tokens for integrity=SELECTIVE
Browse files Browse the repository at this point in the history
  • Loading branch information
lacanoid committed Jun 3, 2021
1 parent 1294ed7 commit 17a240c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Version 0.13
- trim trailing / on directory names for FS datalinks for better file name uniqueness
- dlnewcopy() now stores old token in link
- dlpreviouscopy() looks for this old token first
- store curl_head response code in datalink. This helps in finding broken links and such.
- store curl_head response code in datalink

Version 0.12
------------
Expand Down
4 changes: 2 additions & 2 deletions datalink.sql
Original file line number Diff line number Diff line change
Expand Up @@ -875,14 +875,14 @@ begin
if link_options > 0 then
lco = datalink.link_control_options(link_options);
if lco.integrity <> 'NONE' then
if lco.integrity = 'ALL' and dlurlscheme($1)<>'file' then
if lco.integrity = 'ALL' and dlurlscheme(link)<>'file' then
raise exception 'INTEGRITY ALL can only be used with file URLs'
using errcode = 'HW005',
detail = url,
hint = 'make sure you are using a file: URL scheme';
end if;
-- check if reference exists
has_token := 1;
if lco.integrity = 'ALL' then has_token := 1; end if;
r := datalink.curl_get(url,true);
if not r.ok then
raise exception 'datalink exception - referenced file does not exist'
Expand Down
4 changes: 2 additions & 2 deletions test/expected/other.out
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ PL/pgSQL function dl_trigger_table() line 49 at assignment
select dlurlcomplete(link), (link)->>'token' is not null as has_token from sample_datalinks2;
dlurlcomplete | has_token
-------------------------+-----------
file:///etc | t
https://www.debian.org/ | t
file:///etc | f
https://www.debian.org/ | f
(2 rows)

create table sample_datalinks3 as
Expand Down

0 comments on commit 17a240c

Please sign in to comment.