1
0
mirror of https://github.com/sasjs/core.git synced 2026-01-04 16:10:06 +00:00

fix: adding authentication to server macros. Closes #221

This commit is contained in:
Allan Bowe
2022-04-20 15:41:36 +00:00
parent c4cb0b2395
commit 11da53f1cb
7 changed files with 82 additions and 26 deletions

View File

@@ -17,6 +17,8 @@
@param [in] driveloc The full path to the file in SASjs Drive
@param [in] mdebug= (0) Set to 1 to enable DEBUG messages
<h4> SAS Macros </h4>
@li mf_getuniquefileref.sas
**/
@@ -24,12 +26,23 @@
,mdebug=0
);
proc http method='DELETE'
%local headref;
%let headref=%mf_getuniquefileref();
data _null_;
file &headref lrecl=1000;
infile "&_sasjs_tokenfile" lrecl=1000;
input;
put "Authorization: Bearer " _infile_;
run;
proc http method='DELETE' headerin=&headref
url="&_sasjs_apiserverurl/SASjsApi/drive/file?_filePath=&driveloc";
%if &mdebug=1 %then %do;
debug level=2;
%end;
run;
filename &headref clear;
%mend ms_deletefile;