azure-auth-keys.xml.template 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  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. <configuration>
  14. <!--====================== IMPORTANT!! ========================-->
  15. <!--
  16. 1. COPY THE CONTENTS OF THIS FILE TO "azure-auth-keys.xml" AND THEN EDIT.
  17. 2. UPDATE runtests.sh
  18. A. "fs.azure.abfs.account.name" AND "fs.azure.test.namespace.enabled"
  19. ARE MANDATORY WITH EVERY SCENARIO. AUTHTYPE BY DEFAULT WILL BE
  20. SHAREDKEY AS CONFIGURED IN THIS TEMPLATE FILE.
  21. B. PLEASE ADD MORE SCENARIOS IF THE CODE CHANGE REQUIRES TESTING WITH
  22. DIFFERENT VARIANTS OF CONFIGS.
  23. 3. THE SCRIPT REQUIRES THE FOLLOWING UTILITIES xmlstarlet AND pcregrep
  24. 4. NOW THE SCRIPT CAN BE EXECUTED WITH ./runtests.sh
  25. -->
  26. <!--=============== Auth type ===============-->
  27. <property>
  28. <name>fs.azure.account.auth.type</name>
  29. <value>SharedKey</value>
  30. </property>
  31. <!--=============== Auth related accounts ===============-->
  32. <!-- This set of configs needs to be provided for all the accounts with which
  33. the tests needs to be ran. -->
  34. <property>
  35. <name>fs.azure.account.key.{ABFS_ACCOUNT_NAME}.dfs.core.windows.net</name>
  36. <value>{ACCOUNT_ACCESS_KEY}</value>
  37. <description>Account access key</description>
  38. </property>
  39. <property>
  40. <name>
  41. fs.azure.account.oauth.provider.type.{ABFS_ACCOUNT_NAME}.dfs.core.windows.net
  42. </name>
  43. <value>org.apache.hadoop.fs.azurebfs.oauth2.ClientCredsTokenProvider</value>
  44. <description>OAuth token provider implementation class</description>
  45. </property>
  46. <property>
  47. <name>
  48. fs.azure.account.oauth2.client.endpoint.{ABFS_ACCOUNT_NAME}.dfs.core.windows.net
  49. </name>
  50. <value>https://login.microsoftonline.com/{TENANTID}/oauth2/token</value>
  51. <description>Token end point, this can be found through Azure portal
  52. </description>
  53. </property>
  54. <property>
  55. <name>
  56. fs.azure.account.oauth2.client.id.{ABFS_ACCOUNT_NAME}.dfs.core.windows.net
  57. </name>
  58. <value>{client id}</value>
  59. <description>AAD client id.</description>
  60. </property>
  61. <property>
  62. <name>
  63. fs.azure.account.oauth2.client.secret.{ABFS_ACCOUNT_NAME}.dfs.core.windows.net
  64. </name>
  65. <value>{client secret}</value>
  66. <description>AAD client secret</description>
  67. </property>
  68. <!--=============== Configs for hadoop contract tests for ABFS ===============-->
  69. <property>
  70. <name>fs.contract.test.fs.abfs</name>
  71. <value>abfs://{CONTAINER_NAME}@{ACCOUNT_NAME}.dfs.core.windows.net</value>
  72. </property>
  73. <property>
  74. <name>fs.contract.test.fs.abfss</name>
  75. <value>abfss://{CONTAINER_NAME}@{ACCOUNT_NAME}.dfs.core.windows.net</value>
  76. </property>
  77. <!--=============== WASB Configs ===============-->
  78. <property>
  79. <name>fs.azure.wasb.account.name</name>
  80. <value>{WASB_ACCOUNT_NAME}.blob.core.windows.net</value>
  81. </property>
  82. <property>
  83. <name>fs.azure.account.key.{WASB_ACCOUNT_NAME}.blob.core.windows.net</name>
  84. <value>WASB account key</value>
  85. </property>
  86. <property>
  87. <name>fs.contract.test.fs.wasb</name>
  88. <value>wasb://{WASB_FILESYSTEM}@{WASB_ACCOUNT_NAME}.blob.core.windows.net
  89. </value>
  90. </property>
  91. <!--============= Configs for ITestAzureBlobFileSystemOauth tests ===============-->
  92. <property>
  93. <name>fs.azure.account.oauth2.contributor.client.id</name>
  94. <value>{Client id of SP with RBAC Storage Blob Data Contributor}</value>
  95. </property>
  96. <property>
  97. <name>fs.azure.account.oauth2.contributor.client.secret</name>
  98. <value>{Client secret of SP with RBAC Storage Blob Data Contributor}</value>
  99. </property>
  100. <property>
  101. <name>fs.azure.account.oauth2.reader.client.id</name>
  102. <value>{Client id of SP with RBAC Storage Blob Data Reader}</value>
  103. </property>
  104. <property>
  105. <name>fs.azure.account.oauth2.reader.client.secret</name>
  106. <value>{Client secret of SP with RBAC Storage Blob Data Reader}</value>
  107. </property>
  108. <!--=========================== FOR CheckAccess =========================-->
  109. <!-- To run ABFS CheckAccess tests, you must register an app, with no role
  110. assignments, and set the configuration discussed below:
  111. 1) Register a new app with no RBAC
  112. 2) As part of the test configs you need to provide the guid for the above
  113. created app. Please follow the below steps to fetch the guid.
  114. a) Get an access token with the above created app. Please refer the
  115. following documentation for the same. https://docs.microsoft
  116. .com/en-us/azure/active-directory/develop/v2-oauth2-client-creds-grant-flow#get-a-token
  117. b) Decode the token fetched with the above step. You may use https
  118. ://jwt.ms/ to decode the token
  119. d) The oid field in the decoded string is the guid.
  120. 3) Set the following configurations:
  121. -->
  122. <property>
  123. <name>fs.azure.account.test.oauth2.client.id</name>
  124. <value>{client id}</value>
  125. <description>The client id(app id) for the app created on step 1
  126. </description>
  127. </property>
  128. <property>
  129. <name>fs.azure.account.test.oauth2.client.secret</name>
  130. <value>{client secret}</value>
  131. <description>
  132. The client secret(application's secret) for the app created on step 1
  133. </description>
  134. </property>
  135. <property>
  136. <name>fs.azure.check.access.testuser.guid</name>
  137. <value>{guid}</value>
  138. <description>The guid fetched on step 2</description>
  139. </property>
  140. <property>
  141. <name>fs.azure.account.oauth2.client.endpoint.{account name}.dfs.core
  142. .windows.net</name>
  143. <value>https://login.microsoftonline.com/{TENANTID}/oauth2/token</value>
  144. <description>
  145. Token end point. This can be found through Azure portal. As part of CheckAccess
  146. test cases. The access will be tested for an FS instance created with the
  147. above mentioned client credentials. So this configuration is necessary to
  148. create the test FS instance.
  149. </description>
  150. </property>
  151. <!--========== Append blob related configs ===========-->
  152. <property>
  153. <name>fs.azure.test.appendblob.enabled</name>
  154. <value>false</value>
  155. <description>If made true, tests will be running under the assumption that
  156. append blob is enabled and the root directory and contract test root
  157. directory will be part of the append blob directories. Should be false for
  158. non-HNS accounts.
  159. </description>
  160. </property>
  161. </configuration>