datahub/datahub-frontend
david-leifker ecc01b9a46
refactor(restli-mce-consumer) (#6744)
* fix(security): commons-text in frontend

* refactor(restli): set threads based on cpu cores
feat(mce-consumers): hit local restli endpoint

* testing docker build

* Add retry configuration options for entity client

* Kafka debugging

* fix(kafka-setup): parallelize topic creation

* Adjust docker build

* Docker build updates

* WIP

* fix(lint): metadata-ingestion lint

* fix(gradle-docker): fix docker frontend dep

* fix(elastic): fix race condition between gms and mae for index creation

* Revert "fix(elastic): fix race condition between gms and mae for index creation"

This reverts commit 9629d12c3bdb3c0dab87604d409ca4c642c9c6d3.

* fix(test): fix datahub frontend test for clean/test cycle

* fix(test): datahub-frontend missing assets in test

* fix(security): set protobuf lib datahub-upgrade & mce/mae-consumer

* gitingore update

* fix(docker): remove platform on docker base image, set by buildx

* refactor(kafka-producer): update kafka producer tracking/logging

* updates per PR feedback

* Add documentation around mce standalone consumer
Kafka consumer concurrency to follow thread count for restli & sql connection pool

Co-authored-by: leifker <dleifker@gmail.com>
Co-authored-by: Pedro Silva <pedro@acryl.io>
2022-12-26 16:09:08 +00:00
..
2022-12-26 16:09:08 +00:00
2019-08-31 20:51:14 -07:00

title
datahub-frontend

DataHub Frontend Proxy

DataHub frontend is a Play service written in Java. It is served as a mid-tier between DataHub GMS which is the backend service and DataHub Web.

Pre-requisites

  • You need to have JDK11 installed on your machine to be able to build DataHub Frontend.
  • You need to have Chrome web browser installed to be able to build because UI tests have a dependency on Google Chrome.

Build

DataHub Frontend is already built as part of top level build:

./gradlew build

However, if you only want to build DataHub Frontend specifically:

./gradlew :datahub-frontend:dist

Dependencies

Before starting DataHub Frontend, you need to make sure that DataHub GMS and all its dependencies have already started and running.

Start via Docker image

Quickest way to try out DataHub Frontend is running the Docker image.

Start via command line

If you do modify things and want to try it out quickly without building the Docker image, you can also run the application directly from command line after a successful build:

cd datahub-frontend/run && ./run-local-frontend

Checking out DataHub UI

After starting your application in one of the two ways mentioned above, you can connect to it by typing below into your favorite web browser:

http://localhost:9002

To be able to sign in, you need to provide your user name. The default account is datahub, password datahub.

Authentication

DataHub frontend leverages Java Authentication and Authorization Service (JAAS) to perform the authentication. By default we provided a DummyLoginModule which will accept any username/password combination. You can update jaas.conf to match your authentication requirement. For example, use the following config for LDAP-based authentication,

WHZ-Authentication {
  com.sun.security.auth.module.LdapLoginModule sufficient
  userProvider="ldaps://<host>:636/dc=<domain>"
  authIdentity="{USERNAME}"
  userFilter="(&(objectClass=person)(uid={USERNAME}))"
  java.naming.security.authentication="simple"
  debug="false"
  useSSL="true";
};

Authentication in React

The React app supports both JAAS as described above and separately OIDC authentication. To learn about configuring OIDC for React, see the OIDC in React document.

API Debugging

Most DataHub frontend API endpoints are protected using Play Authentication, which means it requires authentication information stored in the cookie for the request to go through. This makes debugging using curl difficult. One option is to first make a curl call against the /authenticate endpoint and stores the authentication info in a cookie file like this

curl -c cookie.txt -d '{"username":"datahub", "password":"datahub"}' -H 'Content-Type: application/json' http://localhost:9002/authenticate

You can then make all subsequent calls using the same cookie file to pass the authentication check.

curl -b cookie.txt "http://localhost:9001/api/v2/search?type=dataset&input=page"