Skip to content

Commit

Permalink
Merge branch 'master' of github.com:yahoo/kafka-manager into reassign…
Browse files Browse the repository at this point in the history
…-partitions-with-replication-factor
  • Loading branch information
Ciprian Sofronia committed Apr 10, 2019
2 parents aefdec1 + d187627 commit 69c605e
Show file tree
Hide file tree
Showing 106 changed files with 3,763 additions and 1,901 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ jdk: oraclejdk8
install: true
script: travis_wait 30 ./sbt clean coverage assembly
scala:
- 2.11.7
- 2.12.8
#after_success:
# - sbt coverageReport coveralls

cache:
directories:
- $HOME/.sbt/0.13/dependency
- $HOME/.sbt/1.0/dependency
- $HOME/.sbt/boot/scala*
- $HOME/.sbt/launchers
- $HOME/.ivy2/cache
Expand Down
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,46 @@ You should increase the above for large # of consumers with consumer polling ena

Kafka managed consumer offset is now consumed by KafkaManagedOffsetCache from the "__consumer_offsets" topic. Note, this has not been tested with large number of offsets being tracked. There is a single thread per cluster consuming this topic so it may not be able to keep up on large # of offsets being pushed to the topic.

### Authenticating a User with LDAP
Warning, you need to have SSL configured with Kafka Manager to ensure your credentials aren't passed unencrypted.
Authenticating a User with LDAP is possible by passing the user credentials with the Authorization header.
LDAP authentication is done on first visit, if successful, a cookie is set.
On next request, the cookie value is compared with credentials from Authorization header.
LDAP support is through the basic authentication filter.

1. Configure basic authentication
- basicAuthentication.enabled=true
- basicAuthentication.realm=< basic authentication realm>

2. Encryption parameters (optional, otherwise randomly generated on startup) :
- basicAuthentication.salt="some-hex-string-representing-byte-array"
- basicAuthentication.iv="some-hex-string-representing-byte-array"
- basicAuthentication.secret="my-secret-string"

3. Configure LDAP/LDAPS authentication
- basicAuthentication.ldap.enabled=< Boolean flag to enable/disable ldap authentication >
- basicAuthentication.ldap.server=< fqdn of LDAP server>
- basicAuthentication.ldap.port=< port of LDAP server>
- basicAuthentication.ldap.username=< LDAP search username>
- basicAuthentication.ldap.password=< LDAP search password>
- basicAuthentication.ldap.search-base-dn=< LDAP search base>
- basicAuthentication.ldap.search-filter=< LDAP search filter>
- basicAuthentication.ldap.connection-pool-size=< number of connection to LDAP server>
- basicAuthentication.ldap.ssl=< Boolean flag to enable/disable LDAPS>

#### Example (Online LDAP Test Server):

- basicAuthentication.ldap.enabled=true
- basicAuthentication.ldap.server="ldap.forumsys.com"
- basicAuthentication.ldap.port=389
- basicAuthentication.ldap.username="cn=read-only-admin,dc=example,dc=com"
- basicAuthentication.ldap.password="password"
- basicAuthentication.ldap.search-base-dn="dc=example,dc=com"
- basicAuthentication.ldap.search-filter="(uid=$capturedLogin$)"
- basicAuthentication.ldap.connection-pool-size=10
- basicAuthentication.ldap.ssl=false


Deployment
----------

Expand Down
9 changes: 5 additions & 4 deletions app/controllers/ApiHealth.scala
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package controllers

import play.api.i18n.{I18nSupport, MessagesApi}
import play.api.i18n.I18nSupport
import play.api.mvc._

class ApiHealth(val messagesApi: MessagesApi) extends Controller with I18nSupport {
import scala.concurrent.ExecutionContext

def ping = Action {
class ApiHealth(val cc: ControllerComponents)(implicit ec:ExecutionContext) extends AbstractController(cc) with I18nSupport {

def ping = Action { implicit request:RequestHeader =>
Ok("healthy").withHeaders("X-Frame-Options" -> "SAMEORIGIN")
}

}
12 changes: 6 additions & 6 deletions app/controllers/Application.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ package controllers

import features.ApplicationFeatures
import models.navigation.Menus
import play.api.i18n.{MessagesApi, I18nSupport}
import play.api.i18n.I18nSupport
import play.api.mvc._

import scala.concurrent.ExecutionContext

/**
* @author hiral
*/
class Application (val messagesApi: MessagesApi, val kafkaManagerContext: KafkaManagerContext)
(implicit af: ApplicationFeatures, menus: Menus) extends Controller with I18nSupport {

import play.api.libs.concurrent.Execution.Implicits.defaultContext
class Application(val cc: ControllerComponents, kafkaManagerContext: KafkaManagerContext)
(implicit af: ApplicationFeatures, menus: Menus, ec:ExecutionContext) extends AbstractController(cc) with I18nSupport {

private[this] val kafkaManager = kafkaManagerContext.getKafkaManager

def index = Action.async {
def index = Action.async { implicit request: RequestHeader =>
kafkaManager.getClusterList.map { errorOrClusterList =>
Ok(views.html.index(errorOrClusterList)).withHeaders("X-Frame-Options" -> "SAMEORIGIN")
}
Expand Down
Loading

0 comments on commit 69c605e

Please sign in to comment.