You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by pl...@apache.org on 2017/11/15 05:12:15 UTC

[10/10] directory-kerby git commit: Add the HAS project to Kerby.

Add the HAS project to Kerby.


Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/be580566
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/be580566
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/be580566

Branch: refs/heads/has
Commit: be58056601b3c9b0ebf070899d53ce325071c635
Parents: 1e6d364
Author: plusplusjiajia <ji...@intel.com>
Authored: Wed Nov 15 13:12:22 2017 +0800
Committer: plusplusjiajia <ji...@intel.com>
Committed: Wed Nov 15 13:12:22 2017 +0800

----------------------------------------------------------------------
 has/LICENSE                                     | 201 ++++++
 has/README.md                                   |  93 +++
 has/build-tools/has-checkstyle.xml              | 150 ++++
 has/build-tools/has-pmd-ruleset.xml             |  39 ++
 has/doc/cross-realm.md                          |  73 ++
 has/doc/deploy-https.md                         | 152 ++++
 has/doc/deploy-spnego.md                        |  13 +
 has/doc/has-design.png                          | Bin 0 -> 70653 bytes
 has/doc/has-ha.md                               | 124 ++++
 has/doc/has-overall.png                         | Bin 0 -> 74116 bytes
 has/doc/has-start.md                            | 183 +++++
 has/doc/mysql-backend.md                        |  23 +
 has/doc/performance-report.md                   |  98 +++
 has/doc/rest-api.md                             | 229 ++++++
 has/has-client/pom.xml                          |  84 +++
 .../has/client/AbstractHasClientPlugin.java     |  44 ++
 .../hadoop/has/client/HasAdminClient.java       | 480 +++++++++++++
 .../hadoop/has/client/HasAuthAdminClient.java   | 553 +++++++++++++++
 .../org/apache/hadoop/has/client/HasClient.java | 677 ++++++++++++++++++
 .../hadoop/has/client/HasClientPlugin.java      |  42 ++
 .../has/client/HasClientPluginRegistry.java     |  63 ++
 .../hadoop/has/client/HasLoginException.java    |  37 +
 .../hadoop/has/client/HasLoginModule.java       | 491 +++++++++++++
 .../src/main/resources/ssl-client.conf.template |  20 +
 has/has-common/pom.xml                          |  67 ++
 .../org/apache/hadoop/has/common/HasAdmin.java  | 140 ++++
 .../org/apache/hadoop/has/common/HasConfig.java | 103 +++
 .../apache/hadoop/has/common/HasConfigKey.java  |  61 ++
 .../apache/hadoop/has/common/HasException.java  |  53 ++
 .../hadoop/has/common/spnego/AuthToken.java     | 217 ++++++
 .../has/common/spnego/AuthenticatedURL.java     | 282 ++++++++
 .../common/spnego/AuthenticationException.java  |  54 ++
 .../hadoop/has/common/spnego/Authenticator.java |  52 ++
 .../common/spnego/KerberosAuthenticator.java    | 359 ++++++++++
 .../common/spnego/KerberosHasAuthenticator.java |  25 +
 .../hadoop/has/common/spnego/KerberosUtil.java  | 262 +++++++
 .../hadoop/has/common/ssl/KeyStoresFactory.java | 254 +++++++
 .../common/ssl/ReloadingX509TrustManager.java   | 208 ++++++
 .../hadoop/has/common/ssl/SSLFactory.java       | 290 ++++++++
 .../has/common/ssl/SSLHostnameVerifier.java     | 615 ++++++++++++++++
 .../has/common/util/ConnectionConfigurator.java |  39 ++
 .../has/common/util/HasJaasLoginUtil.java       | 261 +++++++
 .../apache/hadoop/has/common/util/HasUtil.java  |  93 +++
 .../hadoop/has/common/util/PlatformName.java    |  59 ++
 .../hadoop/has/common/util/StringUtils.java     |  55 ++
 .../has/common/util/URLConnectionFactory.java   | 215 ++++++
 has/has-dist/assembly.xml                       |  56 ++
 has/has-dist/bin/hadmin-local.sh                |  54 ++
 has/has-dist/bin/hadmin-remote.sh               |  56 ++
 has/has-dist/bin/kdcinit.sh                     |  56 ++
 has/has-dist/bin/kinit.sh                       |  38 +
 has/has-dist/bin/klist.sh                       |  37 +
 has/has-dist/bin/login-test.sh                  |  34 +
 has/has-dist/bin/quick-start.sh                 |  68 ++
 has/has-dist/bin/start-has.sh                   | 115 +++
 has/has-dist/bin/stop-has.sh                    |  75 ++
 has/has-dist/conf/backend.conf                  |  23 +
 has/has-dist/conf/hadmin.conf                   |   6 +
 has/has-dist/conf/has-env.sh                    |  29 +
 has/has-dist/conf/has-server.conf               |  27 +
 has/has-dist/conf/kdc.conf                      |  23 +
 has/has-dist/conf/krb5.conf                     |  29 +
 has/has-dist/log4j.properties                   |  27 +
 has/has-dist/pom.xml                            |  91 +++
 has/has-dist/webapps/WEB-INF/web.xml            |  17 +
 has/has-dist/webapps/has/index.html             |  24 +
 has/has-plugins/pom.xml                         |  48 ++
 ...org.apache.hadoop.has.client.HasClientPlugin |  16 +
 ...org.apache.hadoop.has.server.HasServerPlugin |  16 +
 .../plugins/TestHasClientPluginRegistry.java    |  44 ++
 .../plugins/TestHasServerPluginRegistry.java    |  43 ++
 has/has-server/pom.xml                          | 118 ++++
 .../has/server/AbstractHasServerPlugin.java     |  45 ++
 .../hadoop/has/server/HasAuthenException.java   |  37 +
 .../org/apache/hadoop/has/server/HasServer.java | 701 +++++++++++++++++++
 .../hadoop/has/server/HasServerPlugin.java      |  39 ++
 .../has/server/HasServerPluginRegistry.java     |  63 ++
 .../hadoop/has/server/admin/LocalHasAdmin.java  | 382 ++++++++++
 .../hadoop/has/server/kdc/HasKdcHandler.java    | 315 +++++++++
 .../hadoop/has/server/kdc/MySQLConfKey.java     |  52 ++
 .../has/server/kdc/MySQLIdentityBackend.java    | 426 +++++++++++
 .../hadoop/has/server/web/ConfFilter.java       |  54 ++
 .../hadoop/has/server/web/HostRoleType.java     |  55 ++
 .../hadoop/has/server/web/WebConfigKey.java     |  62 ++
 .../apache/hadoop/has/server/web/WebServer.java | 348 +++++++++
 .../hadoop/has/server/web/rest/ConfApi.java     | 196 ++++++
 .../hadoop/has/server/web/rest/HadminApi.java   | 455 ++++++++++++
 .../hadoop/has/server/web/rest/HasApi.java      | 336 +++++++++
 .../server/web/rest/param/AuthTokenParam.java   |  45 ++
 .../has/server/web/rest/param/EnumParam.java    |  51 ++
 .../has/server/web/rest/param/HostParam.java    |  45 ++
 .../server/web/rest/param/HostRoleParam.java    |  45 ++
 .../hadoop/has/server/web/rest/param/Param.java | 123 ++++
 .../server/web/rest/param/PasswordParam.java    |  45 ++
 .../server/web/rest/param/PrincipalParam.java   |  45 ++
 .../has/server/web/rest/param/StringParam.java  |  68 ++
 .../has/server/web/rest/param/TypeParam.java    |  48 ++
 .../src/main/resources/backend.conf.template    |  21 +
 .../src/main/resources/kdc.conf.template        |  23 +
 .../src/main/resources/krb5.conf.template       |  29 +
 .../hadoop/has/server/TestHasWebServer.java     | 128 ++++
 .../hadoop/has/server/TestRestApiBase.java      | 336 +++++++++
 .../org/apache/hadoop/has/server/TestUtil.java  | 368 ++++++++++
 .../hadoop/has/server/json/TestJsonConfApi.java |  83 +++
 .../has/server/json/TestJsonHadminApi.java      |  80 +++
 .../hadoop/has/server/json/TestJsonHasApi.java  |  54 ++
 .../has/server/mysql/TestMySQLConfApi.java      |  70 ++
 .../has/server/mysql/TestMySQLHadminApi.java    |  64 ++
 .../has/server/mysql/TestMySQLHasApi.java       |  46 ++
 .../src/test/resources/conf/backend.conf        |  20 +
 .../src/test/resources/conf/has-server.conf     |  25 +
 has/has-server/src/test/resources/conf/kdc.conf |  23 +
 .../src/test/resources/conf/krb5.conf           |  29 +
 .../src/test/resources/webapps/WEB-INF/web.xml  |  17 +
 .../src/test/resources/webapps/has/index.html   |  24 +
 has/has-tool/has-client-tool/pom.xml            |  33 +
 .../client/hadmin/remote/HadminRemoteTool.java  | 164 +++++
 .../hadmin/remote/cmd/HadminRemoteCmd.java      |  49 ++
 .../remote/cmd/HasRemoteAddPrincipalCmd.java    |  70 ++
 .../cmd/HasRemoteCreatePrincipalsCmd.java       |  82 +++
 .../remote/cmd/HasRemoteDeletePrincipalCmd.java |  89 +++
 .../remote/cmd/HasRemoteDisableConfCmd.java     |  49 ++
 .../remote/cmd/HasRemoteEnableConfCmd.java      |  49 ++
 .../remote/cmd/HasRemoteExportKeytabsCmd.java   |  58 ++
 .../remote/cmd/HasRemoteGetHostRolesCmd.java    |  68 ++
 .../remote/cmd/HasRemoteGetPrincipalsCmd.java   |  76 ++
 .../remote/cmd/HasRemoteRenamePrincipalCmd.java |  91 +++
 .../tool/client/hclient/HasClientLoginTool.java | 269 +++++++
 .../has/tool/client/kdcinit/HasInitTool.java    | 132 ++++
 .../kdcinit/cmd/HasConfKdcBackendCmd.java       |  66 ++
 .../tool/client/kdcinit/cmd/HasConfKdcCmd.java  |  54 ++
 .../client/kdcinit/cmd/HasGetHasconfCmd.java    |  77 ++
 .../client/kdcinit/cmd/HasGetKrb5confCmd.java   |  77 ++
 .../tool/client/kdcinit/cmd/HasInitKdcCmd.java  |  94 +++
 .../client/kdcinit/cmd/HasSetPluginCmd.java     |  53 ++
 .../tool/client/kdcinit/cmd/HasStartKdcCmd.java |  49 ++
 .../has/tool/client/kdcinit/cmd/KdcInitCmd.java |  42 ++
 .../has/tool/client/kinit/KinitOption.java      |  88 +++
 .../hadoop/has/tool/client/kinit/KinitTool.java | 384 ++++++++++
 .../has/tool/client/klist/KlistOption.java      |  66 ++
 .../hadoop/has/tool/client/klist/KlistTool.java | 293 ++++++++
 has/has-tool/has-server-tool/pom.xml            |  38 +
 .../server/hadmin/local/HadminLocalTool.java    | 265 +++++++
 .../hadmin/local/cmd/AddPrincipalCmd.java       |  61 ++
 .../hadmin/local/cmd/AddPrincipalsCmd.java      |  78 +++
 .../hadmin/local/cmd/DeletePrincipalCmd.java    |  80 +++
 .../hadmin/local/cmd/DisableConfigureCmd.java   |  40 ++
 .../hadmin/local/cmd/EnableConfigureCmd.java    |  40 ++
 .../hadmin/local/cmd/ExportKeytabsCmd.java      |  57 ++
 .../hadmin/local/cmd/GetHostRolesCmd.java       |  36 +
 .../hadmin/local/cmd/GetPrincipalCmd.java       |  76 ++
 .../tool/server/hadmin/local/cmd/HadminCmd.java |  42 ++
 .../server/hadmin/local/cmd/KeytabAddCmd.java   |  91 +++
 .../hadmin/local/cmd/ListPrincipalsCmd.java     |  63 ++
 .../hadmin/local/cmd/RenamePrincipalCmd.java    |  82 +++
 has/has-tool/pom.xml                            |  23 +
 has/pom.xml                                     | 128 ++++
 has/supports/hadoop/README.md                   | 339 +++++++++
 has/supports/hadoop/hadoop-2.7.2.patch          | 152 ++++
 has/supports/hbase/README.md                    | 154 ++++
 .../hbase/hbase-1.1.10-hadoop-2.5.1.patch       | 136 ++++
 has/supports/hive/README.md                     |  55 ++
 has/supports/oozie/README.md                    | 105 +++
 has/supports/phoenix/README.md                  |  30 +
 has/supports/presto/README.md                   |  24 +
 has/supports/spark/README.md                    |  26 +
 has/supports/spark/spark-v2.1.1.patch           |  51 ++
 has/supports/thrift/README.md                   |  70 ++
 has/supports/zookeeper/README.md                |  59 ++
 has/supports/zookeeper/conf/jaas.conf           |  13 +
 has/supports/zookeeper/conf/java.env            |   1 +
 has/supports/zookeeper/pom.xml                  |  47 ++
 172 files changed, 19408 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/be580566/has/LICENSE
----------------------------------------------------------------------
diff --git a/has/LICENSE b/has/LICENSE
new file mode 100644
index 0000000..8dada3e
--- /dev/null
+++ b/has/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "{}"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright {yyyy} {name of copyright owner}
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/be580566/has/README.md
----------------------------------------------------------------------
diff --git a/has/README.md b/has/README.md
new file mode 100644
index 0000000..f06b393
--- /dev/null
+++ b/has/README.md
@@ -0,0 +1,93 @@
+# Hadoop Authentication Service (HAS)
+A dedicated Hadoop Authentication Server to support various authentication mechanisms other than just Kerberos. In its core it leverages a Kerby KDC developed by [Apache Kerby](https://github.com/apache/directory-kerby), a sub project of [Apache Directory](http://directory.apache.org).
+
+# High level considerations
+* Hadoop services are still strongly authenticated by Kerberos, as Kerberos is the only means so far to enable Hadoop security.
+* Hadoop users can remain to use their familiar login methods.
+* Security admins won't have to migrate and sync up their user accounts to Kerberos back and forth.
+* New authentication mechanism can be customized and plugined.
+
+# Architecture
+![](https://github.com/intel-bigdata/has/blob/release-1.0.0/doc/has-overall.png)
+
+# Design
+Assuming existing users are stored in a SQL database (like MySQL), the detailed design and workflow may go like the following:
+![](https://github.com/intel-bigdata/has/blob/release-1.0.0/doc/has-design.png)
+
+
+# New mechanism plugin API
+
+## HAS client plugin HasClientPlugin:
+
+```Java
+// Get the login module type ID, used to distinguish this module from others. 
+// Should correspond to the server side module.
+String getLoginType()
+
+// Perform all the client side login logics, the results wrapped in an AuthToken, 
+// will be validated by HAS server.
+AuthToken login(Conf loginConf) throws HasLoginException
+```
+
+## HAS server plugin HasServerPlugin:
+
+```Java
+// Get the login module type ID, used to distinguish this module from others. 
+// Should correspond to the client side module.
+String getLoginType()
+
+// Perform all the server side authentication logics, the results wrapped in an AuthToken, 
+// will be used to exchange a Kerberos ticket.
+AuthToken authenticate(AuthToken userToken) throws HasAuthenException
+```
+
+## REST API
+Please look at [REST API](https://github.com/intel-bigdata/has/blob/release-1.0.0/doc/rest-api.md) for details.
+
+## How to start
+Please look at [How to start](https://github.com/intel-bigdata/has/blob/release-1.0.0/doc/has-start.md) for details.
+
+## High Availability
+Please look at [High Availability](https://github.com/intel-bigdata/has/blob/release-1.0.0/doc/has-ha.md) for details.
+
+## Cross Realm
+Please look at [How to setup cross-realm](https://github.com/intel-bigdata/has/blob/cross-realm/doc/cross-realm.md) for details.
+
+## Enable Hadoop ecosystem components
+
+* [Enable Hadoop](https://github.com/Intel-bigdata/HAS/blob/release-1.0.0/supports/hadoop/README.md)
+
+* [Enable Zookeeper](https://github.com/Intel-bigdata/HAS/blob/release-1.0.0/supports/zookeeper/README.md)
+
+* [Enable HBase](https://github.com/Intel-bigdata/HAS/blob/release-1.0.0/supports/hbase/README.md)
+
+* [Enable Hive](https://github.com/Intel-bigdata/HAS/blob/release-1.0.0/supports/hive/README.md)
+
+* [Enable Phoenix](https://github.com/Intel-bigdata/HAS/blob/release-1.0.0/supports/phoenix/README.md)
+
+* [Enable Thrift](https://github.com/Intel-bigdata/HAS/blob/release-1.0.0/supports/thrift/README.md)
+
+* [Enable Spark](https://github.com/Intel-bigdata/HAS/blob/release-1.0.0/supports/spark/README.md)
+
+* [Enable Oozie](https://github.com/Intel-bigdata/HAS/blob/release-1.0.0/supports/oozie/README.md)
+
+* [Enable Presto](https://github.com/Intel-bigdata/HAS/blob/release-1.0.0/supports/presto/README.md)
+
+## List of supported Hadoop ecosystem components
+
+|   Big Data Components   |           Supported         |   Rebuild Required   |   Configuring Required   |
+|:-----------------------:|:---------------------------:|:--------------------:|:------------------------:|
+| Hadoop                  | Yes                         | Yes                  | Yes                      |
+| Zookeeper               | Yes                         | Yes                  | Yes                      |
+| HBase                   | Yes                         | Yes                  | Yes                      |
+| Hive                    | Yes                         | No                   | Yes                      |
+| Phoenix                 | Yes                         | No                   | Yes                      |
+| Thrift                  | Yes                         | No                   | Yes                      |
+| Spark                   | Yes                         | No                   | Yes                      |
+| Oozie                   | Yes                         | No                   | Yes                      |
+| Presto                  | Yes (0.148 and later)       | No                   | Yes                      |
+| Pig                     | Yes                         | No                   | No                       |
+| Sqoop                   | Yes                         | No                   | No                       |
+
+## Performance test report
+Please look at [Performance test report](https://github.com/intel-bigdata/has/blob/release-1.0.0/doc/performance-report.md) for details.

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/be580566/has/build-tools/has-checkstyle.xml
----------------------------------------------------------------------
diff --git a/has/build-tools/has-checkstyle.xml b/has/build-tools/has-checkstyle.xml
new file mode 100644
index 0000000..6ab54b0
--- /dev/null
+++ b/has/build-tools/has-checkstyle.xml
@@ -0,0 +1,150 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+  
+  http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<!DOCTYPE module PUBLIC
+    "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
+    "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
+
+<module name="Checker">
+
+    <!-- Checks that property files contain the same keys.         -->
+    <!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
+    <module name="Translation"/>
+
+    <module name="FileLength"/>
+
+    <!-- Following interprets the header file as regular expressions. -->
+    <!-- <module name="RegexpHeader"/>                                -->
+
+    <module name="FileTabCharacter">
+        <property name="eachLine" value="true"/>
+    </module>
+
+    <module name="RegexpSingleline">
+        <!-- \s matches whitespace character, $ matches end of line. -->
+        <property name="format" value="^[^\s][^\*].*\s+$"/>
+        <property name="message" value="Line has trailing spaces."/>
+    </module>
+
+    <module name="TreeWalker">
+
+        <!-- required for SuppressWarningsFilter (and other Suppress* rules not used here) -->
+        <!-- see http://checkstyle.sourceforge.net/config_annotation.html#SuppressWarningsHolder -->
+        <module name="SuppressWarningsHolder"/>
+
+
+        <!-- Checks for Naming Conventions.                  -->
+        <!-- See http://checkstyle.sf.net/config_naming.html -->
+        <module name="ConstantName"/>
+        <module name="LocalFinalVariableName"/>
+        <module name="LocalVariableName"/>
+        <module name="MemberName"/>
+        <module name="MethodName"/>
+        <module name="PackageName"/>
+        <module name="ParameterName"/>
+        <module name="StaticVariableName"/>
+        <module name="TypeName"/>
+
+
+        <!-- Checks for imports                              -->
+        <!-- See http://checkstyle.sf.net/config_import.html -->
+        <!-- module name="AvoidStarImport"/ -->
+        <!--module name="IllegalImport"/--> <!-- defaults to sun.* packages -->
+        <module name="RedundantImport"/>
+        <module name="UnusedImports"/>
+
+
+        <!-- Checks for Size Violations.                    -->
+        <!-- See http://checkstyle.sf.net/config_sizes.html -->
+        <module name="LineLength">
+            <property name="max" value="120"/>
+            <property name="ignorePattern" value="^ *\* *"/>
+        </module>
+        <module name="MethodLength">
+            <property name="max" value="200"/>
+        </module>
+        <module name="ParameterNumber">
+            <property name="max" value="8"/>
+        </module>
+
+
+        <!-- Checks for whitespace                               -->
+        <!-- See http://checkstyle.sf.net/config_whitespace.html -->
+        <module name="EmptyForIteratorPad"/>
+        <module name="MethodParamPad"/>
+        <module name="NoWhitespaceAfter"/>
+        <module name="NoWhitespaceBefore"/>
+        <module name="OperatorWrap"/>
+        <module name="ParenPad"/>
+        <module name="TypecastParenPad"/>
+        <module name="WhitespaceAfter"/>
+        <module name="WhitespaceAround"/>
+
+
+        <!-- Modifier Checks                                    -->
+        <!-- See http://checkstyle.sf.net/config_modifiers.html -->
+        <module name="ModifierOrder"/>
+        <module name="RedundantModifier"/>
+
+
+        <!-- Checks for blocks. You know, those {}'s         -->
+        <!-- See http://checkstyle.sf.net/config_blocks.html -->
+        <module name="AvoidNestedBlocks"/>
+        <module name="EmptyBlock"/>
+        <module name="LeftCurly"/>
+        <module name="NeedBraces"/>
+        <module name="RightCurly"/>
+
+
+        <!-- Checks for common coding problems               -->
+        <!-- See http://checkstyle.sf.net/config_coding.html -->
+        <!-- module name="AvoidInlineConditionals"/ -->
+        <module name="EmptyStatement"/>
+        <module name="EqualsHashCode"/>
+        <module name="IllegalInstantiation"/>
+
+
+        <!-- Checks for class design                         -->
+        <!-- See http://checkstyle.sf.net/config_design.html -->
+        <module name="FinalClass"/>
+        <module name="InterfaceIsType"/>
+
+
+        <!-- Miscellaneous other checks.                   -->
+        <!-- See http://checkstyle.sf.net/config_misc.html -->
+        <module name="ArrayTypeStyle"/>
+        <module name="UpperEll"/>
+
+        <module name="FileContentsHolder"/>
+
+    </module>
+
+    <!-- Support @SuppressWarnings (added in Checkstyle 5.7) -->
+    <!-- see http://checkstyle.sourceforge.net/config.html#SuppressWarningsFilter -->
+    <module name="SuppressWarningsFilter"/>
+
+    <!-- Checks properties file for a duplicated properties. -->
+    <!-- See http://checkstyle.sourceforge.net/config_misc.html#UniqueProperties -->
+    <module name="UniqueProperties"/>
+
+    <module name="SuppressionCommentFilter"/>
+
+</module>

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/be580566/has/build-tools/has-pmd-ruleset.xml
----------------------------------------------------------------------
diff --git a/has/build-tools/has-pmd-ruleset.xml b/has/build-tools/has-pmd-ruleset.xml
new file mode 100644
index 0000000..772e0e3
--- /dev/null
+++ b/has/build-tools/has-pmd-ruleset.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<ruleset name="kerby-pmd" xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
+  <description>
+  A PMD ruleset for Apache Kerby
+  </description>
+
+  <rule ref="rulesets/java/basic.xml">
+     <exclude name="AvoidUsingHardCodedIP" />
+  </rule>
+  <rule ref="rulesets/java/unusedcode.xml"/>
+  <rule ref="rulesets/java/imports.xml"/>
+  <rule ref="rulesets/java/braces.xml"/>
+  <rule ref="rulesets/java/empty.xml"/>
+  <rule ref="rulesets/java/migrating.xml">
+     <exclude name="JUnit4TestShouldUseAfterAnnotation" /> 
+  </rule>
+  <rule ref="rulesets/java/unnecessary.xml"/>
+
+</ruleset>

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/be580566/has/doc/cross-realm.md
----------------------------------------------------------------------
diff --git a/has/doc/cross-realm.md b/has/doc/cross-realm.md
new file mode 100644
index 0000000..8c1fb36
--- /dev/null
+++ b/has/doc/cross-realm.md
@@ -0,0 +1,73 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+Establish cross realm trust
+============
+
+### Synchronize time of realms
+The time of realms should be synchronized.
+
+### Add the same special principals in realms, please select a very strong password
+```
+cd kerby-dist/kdc-dist
+sh bin/kadmin.sh [server-conf-dir] -k [keytab]
+// A.EXAMPLE.COM realm to access a service in the B.EXAMPLE.COM realm
+HadminLocalTool.local: addprinc -pw [same-password] krbtgt/B.EXAMPLE.COM@A.EXAMPLE.COM
+// Make sure that both principals have matching key version numbers and encryption types
+HadminLocalTool.local: getprinc krbtgt/B.EXAMPLE.COM@A.EXAMPLE.COM
+```
+
+### Configure krb5.conf of realms
+
+* config realms and domain_realms sections, make sure the realms are contained.
+
+* config capaths section, which contains the realm chain.
+
+An example of krb5.conf:
+```
+[realms]
+  A.EXAMPLE.COM = {
+    kdc = A.EXAMPLE.COM
+  }
+  B.EXAMPLE.COM = {
+    kdc = B.EXAMPLE.COM
+  }
+
+[domain_realm]
+  .A.EXAMPLE.COM = a.example.com
+  A.EXAMPLE.COM = a.example.com
+  .B.EXAMPLE.COM = b.example.com
+  B.EXAMPLE.COM = b.example.com
+
+[capaths]
+  A.EXAMPLE.COM = {
+    B.EXAMPLE.COM = .
+  }
+  B.EXAMPLE.COM = {
+    A.EXAMPLE.COM = .
+  }
+```
+
+> Make sure the FQDN match the realm name, e.g. if the FQDN is localhost.hadoop.com, the realm should be HADOOP.COM.
+
+### Validate
+```
+cd kerby-dist/tool-dist
+sh bin/kinit.sh -conf [client-conf-dir] -c [credential-cache-of-local-realm] -S [principal-name-of-remote-realm]
+```

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/be580566/has/doc/deploy-https.md
----------------------------------------------------------------------
diff --git a/has/doc/deploy-https.md b/has/doc/deploy-https.md
new file mode 100644
index 0000000..d2ed6a0
--- /dev/null
+++ b/has/doc/deploy-https.md
@@ -0,0 +1,152 @@
+Deploy HTTPS
+===============
+
+## 1. Create a keystore file for each host
+
+> keystore: the keystore file that stores the certificate.      
+> validity: the valid time of the certificate in days.
+```
+keytool -alias {hostname} -keystore {keystore} -validity {validity} -genkey
+```
+
+> The keytool will ask for more details such as the keystore password, keypassword and CN(hostname).
+
+## 2. Export the certificate public key to a certificate file for each host
+```
+keytool -export -alias {hostname} -keystore {keystore} -rfc -file {cert-file}
+```
+
+## 3. Create a common truststore file (trustAll)
+The truststore file contains the public key from all certificates. If you assume a 2-node cluster with node1 and node2,
+login to node1 and import the truststore file for node1.
+```
+keytool -import -alias {hostname} -keystore {trustAll} -file {cert-file}
+```
+
+## 4. Update the common truststore file
+* Move {trustAll} from node1 to node2 ({trustAll} already has the certificate entry of node1), and repeat Step 3.
+
+* Move the updated {trustAll} from node2 to node1. Repeat these steps for each node in the cluster.
+When you finish, the {trustAll} file will have the certificates from all nodes.
+
+> Note these work could be done on the same node, just notice the hostname.
+
+## 5. Copy {trustAll} from node1 to all of the other nodes
+
+## 6. Validate the common truststore file
+```
+keytool -list -v -keystore {trustAll}
+```
+
+## 7. Edit the Configuration files
+> Deploy {keystore} and {trustAll} files and config /etc/has/ssl-server.conf for HAS server
+```
+ssl.server.keystore.location = {path to keystore}
+ssl.server.keystore.password = {keystore password set in step 1}
+ssl.server.keystore.keypassword = {keypassword set in step 1}
+ssl.server.truststore.reload.interval = 1000
+ssl.server.truststore.location = {path to trustAll}
+ssl.server.truststore.password = {trustAll password set in step 2}
+```
+
+> Config /etc/has/ssl-client.conf for HAS client
+```
+ssl.client.truststore.location = {path to trustAll}
+ssl.client.truststore.password = {trustAll password}
+```
+
+> Config $HADOOP_HOME/etc/hadoop/ssl-server.xml for Hadoop
+```
+<configuration>
+
+<property>
+  <name>ssl.server.truststore.location</name>
+  <value>path to trustAll</value>
+</property>
+
+<property>
+  <name>ssl.server.truststore.password</name>
+  <value>trustAll password</value>
+</property>
+
+<property>
+  <name>ssl.server.truststore.type</name>
+  <value>jks</value>
+</property>
+
+<property>
+  <name>ssl.server.truststore.reload.interval</name>
+  <value>10000</value>
+</property>
+
+<property>
+  <name>ssl.server.keystore.location</name>
+  <value>path to keystore</value>
+</property>
+
+<property>
+  <name>ssl.server.keystore.password</name>
+  <value>keystore password</value>
+</property>
+
+<property>
+  <name>ssl.server.keystore.keypassword</name>
+  <value>keystore keypassword</value>
+</property>
+
+<property>
+  <name>ssl.server.keystore.type</name>
+  <value>jks</value>
+</property>
+
+</configuration>
+```
+
+> Config $HADOOP_HOME/etc/hadoop/ssl-client.xml for Hadoop
+```
+<configuration>
+
+<property>
+  <name>ssl.client.truststore.location</name>
+  <value>patch to trustAll</value>
+</property>
+
+<property>
+  <name>ssl.client.truststore.password</name>
+  <value>trustAll password</value>
+</property>
+
+<property>
+  <name>ssl.client.truststore.type</name>
+  <value>jks</value>
+</property>
+
+<property>
+  <name>ssl.client.truststore.reload.interval</name>
+  <value>10000</value>
+</property>
+
+<property>
+  <name>ssl.client.keystore.location</name>
+  <value>path to keystore</value>
+</property>
+
+<property>
+  <name>ssl.client.keystore.password</name>
+  <value>keystore password</value>
+</property>
+
+<property>
+  <name>ssl.client.keystore.keypassword</name>
+  <value>keystore keypassword</value>
+</property>
+
+<property>
+  <name>ssl.client.keystore.type</name>
+  <value>jks</value>
+</property>
+
+</configuration>
+```
+
+> To make the nodes in the cluster communicate bidirectionally, deploy all the configuration files.

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/be580566/has/doc/deploy-spnego.md
----------------------------------------------------------------------
diff --git a/has/doc/deploy-spnego.md b/has/doc/deploy-spnego.md
new file mode 100644
index 0000000..cb2339b
--- /dev/null
+++ b/has/doc/deploy-spnego.md
@@ -0,0 +1,13 @@
+Deploy SPNEGO
+================
+
+## 1. Server Side Configuration(in server side has-server.conf)
+
+To use Kerberos SPNEGO as the authentication mechanism, the authentication filter must be configured with the following init parameters:
+- filter_auth_type : the keyword kerberos. For example: filter_auth_type = kerberos
+
+## 2. Client Side Configuration(in client side hadmin.conf)
+
+- filter_auth_type the keyword kerberos.  For example: filter_auth_type = kerberos
+- admin_keytab: The path to the keytab file containning the credential for the admin principal. For example: admin_keytab = /etc/has/admin.keytab Here the admin.keytab the same as the server side.
+- admin_keytab_principal: The admin principal. For example: admin_keytab_principal = kadmin/<YOUR-REALM.COM>@<YOUR-REALM.COM>

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/be580566/has/doc/has-design.png
----------------------------------------------------------------------
diff --git a/has/doc/has-design.png b/has/doc/has-design.png
new file mode 100644
index 0000000..575c503
Binary files /dev/null and b/has/doc/has-design.png differ

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/be580566/has/doc/has-ha.md
----------------------------------------------------------------------
diff --git a/has/doc/has-ha.md b/has/doc/has-ha.md
new file mode 100644
index 0000000..b683878
--- /dev/null
+++ b/has/doc/has-ha.md
@@ -0,0 +1,124 @@
+High Availability Using MySQL Backend
+========================================
+
+The HAS High Availability feature implemented by providing the option of running two redundant HAS servers. 
+
+## Deployment
+
+### 1. Configure has-server.conf
+
+The two redundant HAS servers must have same https ports. Below are examples:
+
+* has-server.conf of HAS server on emr-header-1:
+```
+[HAS]
+  https_host = emr-header-1
+  https_port = 8092
+  filter_auth_type = kerberos
+  enable_conf = true
+
+[PLUGIN]
+  auth_type = RAM
+```
+
+* has-server.conf of HAS server on emr-worker-1:
+```
+[HAS]
+  https_host = emr-worker-1
+  https_port = 8092
+  filter_auth_type = kerberos
+  enable_conf = true
+
+[PLUGIN]
+  auth_type = RAM
+```
+
+### 2. Start HAS servers
+
+### 3. Configure HAS backend
+
+The two redundant HAS servers must use **mysql** backend, and have same *mysql_url*, *mysql_user* and *mysql_password*.
+
+Please look at [How to use mysql backend](https://github.com/intel-bigdata/has/blob/release-1.0.0/doc/mysql-backend.md) for mysql backend configuration.
+
+### 4. Configure HAS KDC
+
+The two redundant HAS servers must have same ports and realms.
+
+### 5. Start and init HAS KDC servers
+
+> After doing init on either HAS server, the other one has been initialized too.
+>
+> Please keep the shared admin.keytab safely.
+
+### 6. Reexport has-client.conf for HAS web server HA
+
+```
+cd HAS/has-dist
+// Start KDC init tool
+sh bin/kdcinit.sh <conf_dir>
+// Get has-client.conf, and put it to /etc/has:
+KdcInitTool: gethas -p /etc/has
+KdcInitTool: exit
+```
+
+You will get has-client.conf like the following:
+```
+[HAS]
+  https_host = emr-header-1,emr-worker-1
+  https_port = 8092
+  filter_auth_type = kerberos
+  enable_conf = true
+
+[PLUGIN]
+  auth_type = RAM
+```
+
+Hadoop user can use HAS HA feature by updating **core-site.xml** without Reexport has-client.conf.
+add the following properties:
+```
+<property>
+   <name>hadoop.security.has</name>
+   <value>https://emr-header-1:8092/has/v1?auth_type=RAM;https://emr-worker-1:8092/has/v1?auth_type=RAM</value>
+</property>
+```
+
+### 7. Reexport krb5.conf for HAS KDC HA
+
+```
+cd HAS/has-dist
+// Start KDC init tool:
+sh bin/kdcinit.sh <conf_dir>
+// Get krb5.conf, and put it to /etc:
+KdcInitTool: getkrb5 -p /etc
+KdcInitTool: exit
+```
+
+You will get krb5.conf like the following:
+```
+[libdefaults]
+    kdc_realm = HADOOP.COM
+    default_realm = HADOOP.COM
+    udp_preference_limit = 4096
+    kdc_tcp_port = 88
+    kdc_udp_port = 88
+
+[realms]
+    HADOOP.COM = {
+        kdc = localhost:88
+        kdc = localhost:88
+    }
+```
+
+## Verification
+
+You can use login-test tool to verify:
+
+### 1. Update hadmin.conf in <conf_dir>
+
+### 2. Run login-test tool
+```
+cd HAS/has-dist
+// Use tgt to login
+sh bin/login-test.sh tgt <conf_dir>
+```

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/be580566/has/doc/has-overall.png
----------------------------------------------------------------------
diff --git a/has/doc/has-overall.png b/has/doc/has-overall.png
new file mode 100644
index 0000000..2df5e48
Binary files /dev/null and b/has/doc/has-overall.png differ

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/be580566/has/doc/has-start.md
----------------------------------------------------------------------
diff --git a/has/doc/has-start.md b/has/doc/has-start.md
new file mode 100644
index 0000000..43bc2eb
--- /dev/null
+++ b/has/doc/has-start.md
@@ -0,0 +1,183 @@
+How to start
+================
+
+## 1. Install
+
+### Download HAS source code:
+```
+git clone https://github.com/Intel-bigdata/HAS.git
+```
+
+### Install HAS:
+```
+cd HAS
+mvn clean install
+```
+
+## 2. Start and configure HAS server
+
+### Deploy https
+Please look at [How to deploy https](https://github.com/intel-bigdata/has/blob/release-1.0.0/doc/deploy-https.md) for details.
+
+### Configure has-server.conf in <conf_dir>:
+An example of has-server.conf:
+```
+[HAS]
+  https_host = localhost
+  https_port = 8092
+  filter_auth_type = kerberos
+  
+[PLUGIN]
+  auth_type = RAM
+```
+
+### Start HAS server:
+```
+cd HAS/has-dist
+sh bin/start-has.sh <conf_dir> <work_dir>
+```
+
+also:
+```
+export HAS_CONF_DIR=<conf_dir>
+export HAS_WORK_DIR=<work_dir>
+cd HAS/has-dist
+sh bin/start-has.sh
+```
+
+Root privileges required if https_port or KDC port numbers range from 0 to 1023.
+
+### Configure HAS plugin:
+```
+cd HAS/has-dist
+// Proxy needed to be removed if it exists
+unset https_proxy
+// Start KDC init tool
+sh bin/kdcinit.sh <conf_dir>
+// Also: sh bin/kdcinit.sh, if HAS_CONF_DIR environment variable has been set.
+// Plugin_name example: RAM
+KdcInitTool: set_plugin <plugin_name>
+KdcInitTool: exit
+```
+
+### Configure HAS backend:
+```
+cd HAS/has-dist
+// Start KDC init tool
+sh bin/kdcinit.sh <conf_dir>
+// An example of json backend:
+KdcInitTool: config_kdcBackend json /tmp/has/jsonbackend
+// An example of mysql backend:
+KdcInitTool: config_kdcBackend mysql jdbc:mysql://127.0.0.1:3306/mysqlbackend root passwd
+KdcInitTool: exit
+```
+For mysql backend, please refer to [How to use mysql backend](https://github.com/intel-bigdata/has/blob/release-1.0.0/doc/mysql-backend.md) for details.
+
+### Configure HAS KDC:
+```
+cd HAS/has-dist
+// Start KDC init tool
+sh bin/kdcinit.sh <conf_dir>
+// An example of configure HAS KDC:
+KdcInitTool: config_kdc localhost 88 HADOOP.COM
+KdcInitTool: exit
+```
+Please make sure the following configuration files exist in the conf directory:
+has-server.conf backend.conf kdc.conf
+
+### Start HAS KDC server:
+```
+cd HAS/has-dist
+// Start KDC init tool
+sh bin/kdcinit.sh <conf_dir>
+KdcInitTool: start
+KdcInitTool: exit
+```
+
+### Init HAS server:
+```
+cd HAS/has-dist
+// Start KDC init tool
+sh bin/kdcinit.sh <conf_dir>
+KdcInitTool: init
+KdcInitTool: exit
+```
+
+### Deploy http spnego
+Please look at [How to deploy http spnego](https://github.com/intel-bigdata/has/blob/release-1.0.0/doc/deploy-spnego.md) for details.
+Please restart the HAS server
+
+```
+cd HAS/has-dist
+sh bin/stop-has.sh
+
+cd HAS/has-dist
+sh bin/start-has.sh <conf_dir> <work_dir>
+
+cd HAS/has-dist
+sh bin/kdcinit.sh <conf_dir>
+KdcInitTool: start
+KdcInitTool: exit
+```
+
+### Get krb5.conf:
+```
+cd HAS/has-dist
+// Start KDC init tool:
+sh bin/kdcinit.sh <conf_dir>
+// Get krb5.conf, and put it to /etc:
+KdcInitTool: getkrb5 -p /etc
+KdcInitTool: exit
+```
+
+### Get has-client.conf:
+```
+cd HAS/has-dist
+// Start KDC init tool
+sh bin/kdcinit.sh <conf_dir>
+// Get has-client.conf, and put it to /etc/has:
+KdcInitTool: gethas -p /etc/has
+KdcInitTool: exit
+```
+
+## 3. Prepare for Hadoop
+
+### Create service principals:
+```
+cd HAS/has-dist
+echo { \
+    HOSTS: [ \
+       {"name":"<host>","hostRoles":"<role>,..., <role>"\}, \
+       ...
+       {"name":"<host>","hostRoles":"<role>,...,<role>"\} \
+    ] \
+\} > hosts.txt
+// Start local hadmin tool
+sh bin/hadmin-local.sh <conf_dir> -k <keytab>
+// Also: sh bin/hadmin-local.sh -k <keytab>, if HAS_CONF_DIR environment variable has been set.
+// Also you can use remote hadmin tool, admin.keytab file needed to be placed in /etc/has
+sh bin/hadmin-remote.sh <conf_dir>
+// Also: sh bin/hadmin-remote.sh, if HAS_CONF_DIR environment variable has been set.
+HadminLocalTool.local: creprincs hosts.txt
+HadminLocalTool.local: exit
+```
+The admin.keytab file is created by the kdcinit. In local and remote hadmin tool, you can type "?" for help.
+
+### Get hostRoles list:
+```
+cd HAS/has-dist
+// Start local or remote hadmin tool
+sh bin/hadmin-local.sh(bin/hadmin-remote.sh) <conf_dir> -k <keytab>
+HadminLocalTool.local: hostroles
+HadminLocalTool.local: exit
+```
+
+### Export service keytabs:
+```
+cd HAS/has-dist
+// Start local or remote hadmin tool
+sh bin/hadmin-local.sh(bin/hadmin-remote.sh) <conf_dir> -k <keytab>
+// An example of exporting keytabs of localhost(hostname):
+HadminLocalTool.local: expkeytabs localhost
+HadminLocalTool.local: exit
+```

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/be580566/has/doc/mysql-backend.md
----------------------------------------------------------------------
diff --git a/has/doc/mysql-backend.md b/has/doc/mysql-backend.md
new file mode 100644
index 0000000..4a06be3
--- /dev/null
+++ b/has/doc/mysql-backend.md
@@ -0,0 +1,23 @@
+MySQL Backend
+===============
+
+## Install MySQL
+
+Please refer to [install mysql](https://dev.mysql.com/doc/refman/5.7/en/linux-installation.html).
+
+## Config backend
+```
+// Url: jdbc url of mysql database; mysqlbackend: name of has mysql backend database; username: mysql user name; password: mysql password
+cd HAS/has-dist
+sh bin/kdcinit.sh conf
+KdcInitTool: config_kdcBackend mysql jdbc:mysql://127.0.0.1:3306/mysqlbackend?createDatabaseIfNotExist=true root passwd
+KdcInitTool: exit
+```
+
+## Config kdc
+```
+cd HAS/has-dist
+sh bin/kdcinit.sh conf
+KdcInitTool: config_kdc localhost 88 HADOOP.COM
+KdcInitTool: exit
+```

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/be580566/has/doc/performance-report.md
----------------------------------------------------------------------
diff --git a/has/doc/performance-report.md b/has/doc/performance-report.md
new file mode 100644
index 0000000..e542782
--- /dev/null
+++ b/has/doc/performance-report.md
@@ -0,0 +1,98 @@
+# HAS Performance Test Report
+
+## 1. Overview
+
+HAS is a dedicated Hadoop authentication server to support various authentication mechanisms other than just Kerberos. With HAS users can remain their familiar login methods, and new authentication mechanism could be customized and plugined.  
+
+A Hadoop cluster could have thousands of nodes, there maybe so many authentication  requests are sent to HAS server at the same time. So the stability in high concurrency is so important for HAS.
+
+## 2. Test Environment
+
+The test use Alibaba Cloud Elastic Compute Service, detailed test environment like the following: 
+
+### 2.1 Hardware environment
+
+* HAS Server:
+
+> CPU:Intel(R) Xeon(R)CPU E5-2682 @ 2.50GHz    
+> MEM: 16GB    
+> Disk: 43GB 86GB    
+
+* HAS Client:
+
+> CPU:Intel(R) Xeon(R)CPU E5-2682 @ 2.50GHz    
+> MEM: 16GB    
+> Disk: 43GB 86GB * 3
+
+### 2.2 Software environment
+
+> OS: CentOS 7.2    
+> JAVA: 1.8    
+> HAS: 1.0.0    
+> MySQL: 5.5.52  
+
+## 3. Test Method
+
+By using [login-test](https://github.com/Intel-bigdata/HAS/blob/master/has-dist/bin/login-test.sh) scripting tool, the test can be broadly divided into four steps:
+
+1. Add principals to HAS server
+2. Export keytab files to HAS Client  
+    
+    ```shell
+    cd HAS/has-dist         
+    sh bin/login-test add <conf_dir> <work_dir> <principal_num>
+    ```
+
+3. Use keytab files to login concurrently
+
+    ```shell                        
+    sh bin/login-test run <conf_dir> <work_dir> <concurrency_num>
+    ```
+
+4. Record login result and the cost time of login
+
+Testing process like the following:
+
+![testing process](https://user-images.githubusercontent.com/9171954/27905170-b7637602-6271-11e7-8fc9-27d494f9b1ee.jpg)
+
+## 4. Test Result
+
+The test result consists of total cost time and time per request of login using keytab file.
+
+### 4.1 Using Json Backend
+
+| Concurrency | 100 | 500 | 1000 | 5000 | 8000 | 10000 |
+| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
+| Result | Success | Success  | Success  | Success | Success | Success |
+| Total time (ms) | 540 | 1115 | 1661  | 4571 | 6328 | 7208 |
+| Time per request (ms)| 5.400 | 2.230 | 1.661 | 0.914 | 0.791 | 0.721 |
+
+### 4.2 Using MySQL Backend
+
+MySQL Configuration:
+> max connection: 5000              
+> innodb buffer size: 8G
+
+| Concurrency | 100 | 500 | 1000 | 5000 | 8000 | 10000 |
+| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
+| Result | Success | Success  | Success  | Success | Success | Success |
+| Total time (ms) | 765 | 2880  | 4821  | 12712 | 21419 | 22968 |
+| Time per request (ms)| 7.650 | 5.760  | 4.821  | 2.542 | 2.677 | 2.297 |
+
+## 5. Conclusion
+
+![performance in different backends](https://user-images.githubusercontent.com/9171954/27905152-a9bc2a44-6271-11e7-8ddc-16222ee7d3c4.png)
+
+Figure above demonstrates the time per request of HAS authentication in different backends and concurrency. As can be seen, HAS can complete authentication work in high concurrency, and has a good performance. So HAS is good enough for Hadoop.
+
+The CPU utilization and network IO of HAS server are demonstrated in the appendix, with the number of concurrency up to 10000. The appendix shows that HAS server is not under heavy workload in mysql backend. 
+
+## 6. Appendix
+
+* CPU Utilization
+
+![cpu utilization](https://user-images.githubusercontent.com/9171954/27905176-bf7ea410-6271-11e7-904e-abd1bf532725.jpg)
+
+* Network IO
+
+![network io](https://user-images.githubusercontent.com/9171954/27905186-c717b784-6271-11e7-96d3-2fd317defd96.jpg)

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/be580566/has/doc/rest-api.md
----------------------------------------------------------------------
diff --git a/has/doc/rest-api.md b/has/doc/rest-api.md
new file mode 100644
index 0000000..085471b
--- /dev/null
+++ b/has/doc/rest-api.md
@@ -0,0 +1,229 @@
+REST API
+==========
+
+## Config API        AuthType:HTTPS
+
+### Set HAS Plugin
+* Submit a HTTP PUT request.
+```
+    https://<host>:<port>/has/v1/conf/setplugin?plugin=<plugin>
+```
+Example:
+```
+    put https://<host>:<port>/has/v1/conf/setplugin?plugin=RAM
+    Code:200
+    Content-Type:text/plain
+    Content:
+        HAS plugin set successfully.
+```
+### Configure HAS backend
+* Submit a HTTP PUT request.
+```
+    https://<host>:<port>/has/v1/conf/configkdcbackend?backendType=<backendType>
+        [&dir=<dir>] [&url=<url>] [&user=<user>] [&password=<password>]
+```
+Example:
+```
+    PUT https://<host>:<port>/has/v1/conf/configkdcbackend?backendType=json&dir=/tmp/has/jsonbackend
+    Code:200
+    Content-Type:text/plain
+    Content:
+        Json backend set successfully.
+```
+### Configure HAS KDC
+* Submit a HTTP PUT request.
+```
+    https://<host>:<port>/has/v1/conf/configkdc?realm=<realm>&host=<host>&port=<port>
+```
+Example:
+```
+    PUT https://<host>:<port>/has/v1/conf/configkdc?realm=HADOOP.COM&host=localhost&port=88
+    Code:200
+    Content-Type:text/plain
+    Content:
+        HAS server KDC set successfully.
+ ```   
+### Get HAS krb5 conf
+* Submit a HTTP GET request.
+```
+    https://<host>:<port>/has/v1/getkrb5conf
+```
+Example:
+```   
+    GET https://<host>:<port>/has/v1/getkrb5conf
+    Code:200
+    Content-Disposition:attachment;filename=krb5.conf
+```
+### Get Has conf
+* Submit a HTTP GET request.
+```
+    https://<host>:<port>/has/v1/gethasconf
+```
+Example:
+```
+    GET https://<host>:<port>/has/v1/gethasconf
+    Code:200
+    Content-Disposition:attachment;filename=has-client.conf
+```
+## Admin API        AuthType:HTTPS,kerberos  
+### Get HAS principals
+* Submit a HTTP GET request.
+```
+    https://<host>:<port>/has/v1/admin/getprincipals [?exp=<exp>]
+```
+Example:
+```   
+    GET https://<host>:<port>/has/v1/admin/getprincipals
+    Code:200
+    Content-Type:application/json
+    Content:
+        {
+            "result":"success",
+            "msg":"[
+                        \"HTTP\\\/host1@HADOOP.COM\",
+                        \"HTTP\\\/host2@HADOOP.COM\",
+                        \"hbase\\\/host2@HADOOP.COM\",
+                        \"hdfs\\\/host1@HADOOP.COM\",
+                        \"hdfs\\\/host2@HADOOP.COM\",
+                        \"yarn\\\/host1@HADOOP.COM\",
+                        \"yarn\\\/host2@HADOOP.COM\"
+                   ]"
+        }
+```     
+### Add HAS principal
+```
+    https://<host>:<port>/has/v1/admin/addprincipal?principal=<principal> [&password=<password>]
+```
+Example:
+```
+    POST https://<host>:<port>/has/v1/admin/addprincipal?principal=admin
+    Code:200
+    Content-Type:application/json
+    Content:
+        {
+            "result":"success",
+            "msg":"Add principal successfully."
+        }
+```  
+### Rename HAS principal
+* Submit a HTTP POST request.
+```
+    https://<host>:<port>/has/v1/admin/renameprincipal?oldprincipal=<oldprincipal>&newprincipal=<newprincipal>
+```
+Example:
+```
+    POST https://<host>:<port>/has/v1/admin/renameprincipal?oldprincipal=admin&newprincipal=admin/admin
+    Code:200
+    Content-Type:application/json
+    Content:
+        {
+            "result":"success",
+            "msg":"Rename principal successfully."
+        }
+```   
+### Delete HAS principal
+* Submit a HTTP DELETE request.
+```
+    https://<host>:<port>/has/v1/admin/deleteprincipal?principal=<principal>
+```
+Example:
+```
+    DELETE https://<host>:<port>/has/v1/admin/deleteprincipal?principal=admin'
+    Code:200
+    Content-Type:application/json
+    Content:
+        {
+            "result":"success",
+            "msg":"Delete principal successfully."
+        }
+```     
+### Create service principals
+* Submit a HTTP PUT request.
+```
+    https://<host>:<port>/has/v1/admin/createprincipals
+    Content-Type:application/json
+```
+Example:
+```   
+    Request:
+    PUT https://<host>:<port>/has/v1/admin/createprincipals
+    Content-Type:application/json
+    Content:
+    {
+        HOSTS: [
+            {"name":"host1","hostRoles":"HDFS"},    //hostRoles segmentation by ,
+            {"name":"host2","hostRoles":"HDFS,HBASE"}
+        ] 
+    }
+    Response:
+    Code:200
+    Content-Type:application/json
+    Content:
+        {
+            "result":"success",
+            "msg":"Already add princ :hdfs\/host1@HADOOP.COM
+                   Already add princ :yarn\/host1@HADOOP.COM
+                   Already add princ :hdfs\/host2@HADOOP.COM
+                   Already add princ :yarn\/host2@HADOOP.COM
+                   Already add princ :hbase\/host2@HADOOP.COM"
+        }
+```
+### Export service keytabs
+* Submit a HTTP GET request.
+```
+    https://<host>:<port>/has/v1/kadmin/exportkeytabs?host=<host> [&role=<role>]
+```
+Example:
+```
+    GET https://<host>:<port>/has/v1/admin/exportkeytabs?host=host1
+    Code:200
+    Content-Disposition:attachment;filename=keytab.zip
+```
+## User API        AuthType:HTTPS
+
+### Start HAS server
+* Submit a HTTP GET request.
+```
+    https://<host>:<port>/has/v1/kdcstart
+```
+Example:
+```
+    GET https://<host>:<port>/has/v1/kdcstart
+    Code:200
+    Content-Type:application/json
+    Content:
+        {
+            "result":"success",
+            "msg":"Succeed in starting KDC server."
+        }
+```
+### Init HAS server
+* Submit a HTTP GET request.
+```
+    https://<host>:<port>/has/v1/kdcinit
+```
+Example:
+``` 
+    GET https://<host>:<port>/has/v1/kdcinit
+    Code:200
+    Content-Disposition:attachment;filename=admin.keytab
+```
+### Get hostRoles list
+* Submit a HTTP GET request.
+```
+    https://<host>:<port>/has/v1/hostroles
+```
+Example:
+```
+    GET https://<host>:<port>/has/v1/hostroles
+    Code:200
+    Content-Type:application/json
+    
+    Content:
+    [
+        {"HostRole":"HDFS","PrincipalNames":["HTTP","hdfs"]},
+        {"HostRole":"YARN","PrincipalNames":["yarn"]},
+        {"HostRole":"HBASE","PrincipalNames":["hbase"]},
+        {"HostRole":"ZOOKEEPER","PrincipalNames":["zookeeper"]}
+    ]
+```

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/be580566/has/has-client/pom.xml
----------------------------------------------------------------------
diff --git a/has/has-client/pom.xml b/has/has-client/pom.xml
new file mode 100644
index 0000000..c5cabe9
--- /dev/null
+++ b/has/has-client/pom.xml
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.hadoop</groupId>
+    <artifactId>has-project</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>has-client</artifactId>
+  <description>HAS client</description>
+  <name>HAS client</name>
+  <packaging>jar</packaging>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.kerby</groupId>
+      <artifactId>kerb-core</artifactId>
+      <version>${kerby.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.kerby</groupId>
+      <artifactId>kerb-server-api-all</artifactId>
+      <version>${kerby.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.kerby</groupId>
+      <artifactId>kerb-util</artifactId>
+      <version>${kerby.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>com.sun.jersey</groupId>
+      <artifactId>jersey-client</artifactId>
+      <version>1.19</version>
+    </dependency>
+    <dependency>
+    <groupId>com.sun.jersey</groupId>
+      <artifactId>jersey-json</artifactId>
+      <version>1.19</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-codec</groupId>
+      <artifactId>commons-codec</artifactId>
+      <scope>compile</scope>
+      <version>${commons-codec.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+      <version>${slf4j.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.hadoop</groupId>
+      <artifactId>has-common</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.kerby</groupId>
+      <artifactId>kerb-simplekdc</artifactId>
+      <version>${kerby.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-text</artifactId>
+      <version>1.1</version>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.12</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.glassfish.jersey.containers</groupId>
+      <artifactId>jersey-container-servlet-core</artifactId>
+      <version>2.17</version>
+    </dependency>
+  </dependencies>
+
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/be580566/has/has-client/src/main/java/org/apache/hadoop/has/client/AbstractHasClientPlugin.java
----------------------------------------------------------------------
diff --git a/has/has-client/src/main/java/org/apache/hadoop/has/client/AbstractHasClientPlugin.java b/has/has-client/src/main/java/org/apache/hadoop/has/client/AbstractHasClientPlugin.java
new file mode 100644
index 0000000..9ff9749
--- /dev/null
+++ b/has/has-client/src/main/java/org/apache/hadoop/has/client/AbstractHasClientPlugin.java
@@ -0,0 +1,44 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.has.client;
+
+import org.apache.hadoop.has.common.HasConfig;
+import org.apache.kerby.kerberos.kerb.KrbRuntime;
+import org.apache.kerby.kerberos.kerb.type.base.AuthToken;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public abstract class AbstractHasClientPlugin implements HasClientPlugin {
+    public static final Logger LOG = LoggerFactory.getLogger(AbstractHasClientPlugin.class);
+
+    protected abstract void doLogin(AuthToken token) throws HasLoginException;
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public AuthToken login(HasConfig conf) throws HasLoginException {
+
+        AuthToken authToken = KrbRuntime.getTokenProvider("JWT").createTokenFactory().createToken();
+
+        doLogin(authToken);
+
+        return authToken;
+    }
+
+}