소스 검색

HPCC-22927 RemotePull that needs external Esp should optionally take credentials

Add username/password to Std.File.RemotePull() function

Implement code to handle username/password

Tested manually between two systems where the target was LDAP authentication enabled.

Signed-off-by: Attila Vamos <attila.vamos@gmail.com>
Attila Vamos 5 년 전
부모
커밋
7504819618
3개의 변경된 파일74개의 추가작업 그리고 11개의 파일을 삭제
  1. 9 4
      ecllibrary/std/File.ecl
  2. 63 7
      plugins/fileservices/fileservices.cpp
  3. 2 0
      plugins/fileservices/fileservices.hpp

+ 9 - 4
ecllibrary/std/File.ecl

@@ -677,11 +677,16 @@ EXPORT Replicate(varstring logicalName, integer4 timeOut=-1, varstring espServer
  * @param wrap          Should the fileparts be wrapped when copying to a smaller sized cluster?  The default is FALSE.
  * @param noSplit       Don't split a file part to multiple target parts. Default is FALSE.
  * @param expireDays    Number of days to auto-remove file. Default is -1, not expire.
+ * @param username      String containing a username to use for authenticated access to the ESP process; an empty string value
+ *                      indicates that no user authentication is required. OPTIONAL, defaults to an empty string
+ * @param userPW        String containing the password to be used with the user cited in the username argument; if username is
+ *                      empty then this will be ignored; OPTIONAL, defaults to an empty string
+ *
  * @return              The DFU workunit id for the job.
  */
 
-EXPORT varstring fRemotePull(varstring remoteEspFsURL, varstring sourceLogicalName, varstring destinationGroup, varstring destinationLogicalName, integer4 timeOut=-1, integer4 maxConnections=-1, boolean allowOverwrite=FALSE, boolean replicate=FALSE, boolean asSuperfile=FALSE, boolean forcePush=FALSE, integer4 transferBufferSize=0, boolean wrap=FALSE, boolean compress=FALSE, boolean noSplit=FALSE, integer4 expireDays=-1) :=
-    lib_fileservices.FileServices.fRemotePull(remoteEspFsURL, sourceLogicalName, destinationGroup, destinationLogicalName, timeOut, maxConnections, allowOverwrite, replicate, asSuperfile, forcePush, transferBufferSize, wrap, compress, noSplit, expireDays);
+EXPORT varstring fRemotePull(varstring remoteEspFsURL, varstring sourceLogicalName, varstring destinationGroup, varstring destinationLogicalName, integer4 timeOut=-1, integer4 maxConnections=-1, boolean allowOverwrite=FALSE, boolean replicate=FALSE, boolean asSuperfile=FALSE, boolean forcePush=FALSE, integer4 transferBufferSize=0, boolean wrap=FALSE, boolean compress=FALSE, boolean noSplit=FALSE, integer4 expireDays=-1, const varstring username = '', const varstring userPw = '') :=
+    lib_fileservices.FileServices.fRemotePull(remoteEspFsURL, sourceLogicalName, destinationGroup, destinationLogicalName, timeOut, maxConnections, allowOverwrite, replicate, asSuperfile, forcePush, transferBufferSize, wrap, compress, noSplit, expireDays, username, userPw);
 
 /**
  * Same as fRemotePull, but does not return the DFU Workunit ID.
@@ -689,8 +694,8 @@ EXPORT varstring fRemotePull(varstring remoteEspFsURL, varstring sourceLogicalNa
  * @see fRemotePull
  */
 
-EXPORT RemotePull(varstring remoteEspFsURL, varstring sourceLogicalName, varstring destinationGroup, varstring destinationLogicalName, integer4 timeOut=-1, integer4 maxConnections=-1, boolean allowOverwrite=FALSE, boolean replicate=FALSE, boolean asSuperfile=FALSE, boolean forcePush=FALSE, integer4 transferBufferSize=0, boolean wrap=FALSE, boolean compress=FALSE, boolean noSplit=FALSE, integer4 expireDays=-1) :=
-    lib_fileservices.FileServices.RemotePull(remoteEspFsURL, sourceLogicalName, destinationGroup, destinationLogicalName, timeOut, maxConnections, allowOverwrite, replicate, asSuperfile, forcePush, transferBufferSize, wrap, compress, noSplit, expireDays);
+EXPORT RemotePull(varstring remoteEspFsURL, varstring sourceLogicalName, varstring destinationGroup, varstring destinationLogicalName, integer4 timeOut=-1, integer4 maxConnections=-1, boolean allowOverwrite=FALSE, boolean replicate=FALSE, boolean asSuperfile=FALSE, boolean forcePush=FALSE, integer4 transferBufferSize=0, boolean wrap=FALSE, boolean compress=FALSE, boolean noSplit=FALSE, integer4 expireDays=-1, const varstring username = '', const varstring userPw = '') :=
+    lib_fileservices.FileServices.RemotePull(remoteEspFsURL, sourceLogicalName, destinationGroup, destinationLogicalName, timeOut, maxConnections, allowOverwrite, replicate, asSuperfile, forcePush, transferBufferSize, wrap, compress, noSplit, expireDays, username, userPw);
 
 /*------------------------------------- File monitoring functions -------------------------------------------------------*/
 

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 63 - 7
plugins/fileservices/fileservices.cpp


+ 2 - 0
plugins/fileservices/fileservices.hpp

@@ -131,8 +131,10 @@ FILESERVICES_API int  FILESERVICES_CALL fsCompareFiles(ICodeContext *ctx,const c
 FILESERVICES_API char *  FILESERVICES_CALL fsVerifyFile(ICodeContext *ctx,const char *lfn,bool usecrcs);
 FILESERVICES_API void FILESERVICES_CALL fsRemotePull(ICodeContext *ctx, const char * remoteEspFsURL, const char * sourceLogicalName, const char *destinationGroup, const char * destinationLogicalName, int timeOut, int maxConnections, bool overwrite, bool replicate, bool asSuperfile, bool forcePush, int transferBufferSize,bool wrap,bool compress);
 FILESERVICES_API void FILESERVICES_CALL fsRemotePull_v2(ICodeContext *ctx, const char * remoteEspFsURL, const char * sourceLogicalName, const char *destinationGroup, const char * destinationLogicalName, int timeOut, int maxConnections, bool overwrite, bool replicate, bool asSuperfile, bool forcePush, int transferBufferSize,bool wrap,bool compress, bool noSplit=false, int expireDays=-1);
+FILESERVICES_API void FILESERVICES_CALL fsRemotePull_v3(ICodeContext *ctx, const char * remoteEspFsURL, const char * sourceLogicalName, const char *destinationGroup, const char * destinationLogicalName, int timeOut, int maxConnections, bool overwrite, bool replicate, bool asSuperfile, bool forcePush, int transferBufferSize,bool wrap,bool compress, bool noSplit=false, int expireDays=-1, const char *username=nullptr, const char *userPw=nullptr);
 FILESERVICES_API char * FILESERVICES_CALL fsfRemotePull(ICodeContext *ctx, const char * remoteEspFsURL, const char * sourceLogicalName, const char *destinationGroup, const char * destinationLogicalName, int timeOut, int maxConnections, bool overwrite, bool replicate, bool asSuperfile, bool forcePush, int transferBufferSize,bool wrap,bool compress);
 FILESERVICES_API char * FILESERVICES_CALL fsfRemotePull_v2(ICodeContext *ctx, const char * remoteEspFsURL, const char * sourceLogicalName, const char *destinationGroup, const char * destinationLogicalName, int timeOut, int maxConnections, bool overwrite, bool replicate, bool asSuperfile, bool forcePush, int transferBufferSize,bool wrap,bool compress, bool noSplit=false, int expireDays=-1);
+FILESERVICES_API char * FILESERVICES_CALL fsfRemotePull_v3(ICodeContext *ctx, const char * remoteEspFsURL, const char * sourceLogicalName, const char *destinationGroup, const char * destinationLogicalName, int timeOut, int maxConnections, bool overwrite, bool replicate, bool asSuperfile, bool forcePush, int transferBufferSize,bool wrap,bool compress, bool noSplit=false, int expireDays=-1, const char *username=nullptr, const char *userPw=nullptr);
 FILESERVICES_API void FILESERVICES_CALL fsLogicalFileSuperSubList(ICodeContext *ctx,size32_t & __lenResult,void * & __result);
 FILESERVICES_API void FILESERVICES_CALL fslStartSuperFileTransaction(ICodeContext *ctx);
 FILESERVICES_API void FILESERVICES_CALL fslAddSuperFile(ICodeContext *ctx, const char *lsuperfn,const char *_lfn,unsigned atpos=0,bool addcontents=false, bool strict=false);