jsecrets.hpp 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*##############################################################################
  2. HPCC SYSTEMS software Copyright (C) 2020 HPCC Systems®.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. ############################################################################## */
  13. #ifndef JSECRETS_HPP
  14. #define JSECRETS_HPP
  15. #include "jlib.hpp"
  16. #include "jstring.hpp"
  17. extern jlib_decl void setSecretMount(const char * path);
  18. extern jlib_decl void setSecretTimeout(unsigned timeoutMs);
  19. extern jlib_decl IPropertyTree *getLocalSecret(const char *category, const char * name);
  20. extern jlib_decl IPropertyTree *getVaultSecret(const char *category, const char *vaultId, const char * name, const char *version=nullptr);
  21. extern jlib_decl IPropertyTree *getSecret(const char *category, const char * name);
  22. extern jlib_decl bool getSecretKeyValue(MemoryBuffer & result, IPropertyTree *secret, const char * key);
  23. extern jlib_decl bool getSecretKeyValue(StringBuffer & result, IPropertyTree *secret, const char * key);
  24. extern jlib_decl bool getSecretValue(StringBuffer & result, const char *category, const char * name, const char * key, bool required);
  25. extern jlib_decl void initSecretUdpKey();
  26. extern jlib_decl const MemoryAttr &getSecretUdpKey(bool required);
  27. extern jlib_decl IPropertyTree *queryMtlsSecretInfo(const char *name);
  28. extern jlib_decl void splitFullUrl(const char *url, bool &https, StringBuffer &user, StringBuffer &password, StringBuffer &host, StringBuffer &port, StringBuffer &fullpath);
  29. extern jlib_decl void splitUrlSchemeHostPort(const char *url, StringBuffer &user, StringBuffer &password, StringBuffer &schemeHostPort, StringBuffer &path);
  30. extern jlib_decl bool queryMtls();
  31. #endif