Liking cljdoc? Tell your friends :D

kafka-clj.jaas

USAGE: Use for JAAS Kerberos Plain Text

(def tcp-client (... create tcp client ...) (def c (jaas/jaas-login "KafkaClient")) (def sasl-client (jaas/sasl-client c (jaas/principal-name c) broker-host)) (jaas/sasl-handshake! tcp-client sasl-client timeout-ms)

System environment config must be set, see the project.clj file for this project. Properties required are:

-Djava.security.auth.login.config=/vagrant/vagrant/config/kafka_client_jaas.conf -Djava.security.krb5.conf=/vagrant/vagrant/config/krb5.conf

USAGE:
Use for JAAS Kerberos Plain Text


(def tcp-client (... create tcp client ...)
(def c (jaas/jaas-login "KafkaClient"))
(def sasl-client (jaas/sasl-client c (jaas/principal-name c) broker-host))
(jaas/sasl-handshake! tcp-client sasl-client timeout-ms)

System environment config must be set, see the project.clj file for this project.
Properties required are:

-Djava.security.auth.login.config=/vagrant/vagrant/config/kafka_client_jaas.conf
-Djava.security.krb5.conf=/vagrant/vagrant/config/krb5.conf
raw docstring

as-hexclj

(as-hex bts)

HALF-MINUTE-MSclj


handshake-loop!clj

(handshake-loop! conn sasl-client timeout-ms)

handshake-request!clj

(handshake-request! conn)

SaslHandshake API (Key: 17)

  1. SizeInBytes => int16
  2. api_key => INT16 (0) 17
  3. api_version => INT16 (0)
  4. correlation_id => INT32
  5. client_id => NULLABLE_STRING
  6. mechanism => String "GSSAPI" or "PLAIN";
SaslHandshake API (Key: 17)
 1. SizeInBytes => int16
 2. api_key => INT16      (0)    17
 3. api_version => INT16  (0)
 4. correlation_id => INT32
 5. client_id => NULLABLE_STRING
 6. mechanism => String  "GSSAPI" or "PLAIN";
raw docstring

handshake-response!clj

(handshake-response! conn timeout-ms)

;Response:

  1. SizeInBytes => int16
  2. correlation_id => INT32
  3. error_code => INT16 0 => None, 34 => InvalidSaslState, 35 => UnsupportedVersion
  4. enabled_mechanisms => [STRING]
;Response:
1. SizeInBytes => int16
2. correlation_id => INT32
3. error_code => INT16
   0 => None, 34 => InvalidSaslState, 35 => UnsupportedVersion
4. enabled_mechanisms => [STRING]
raw docstring

jaas-expire-timeclj

(jaas-expire-time ctx)

For all KerberosTicket(s) in the LoginContext the min auth time value is returned

For all KerberosTicket(s) in the LoginContext the min auth time value is returned
raw docstring

jaas-expired?clj

(jaas-expired? ctx)

True if the expire time is withing 30 seconds of the current time

True if the expire time is withing 30 seconds of the current time
raw docstring

jaas-loginclj

(jaas-login jaas-name)

jaas-logoutclj

(jaas-logout ctx)

kafka-service-nameclj

(kafka-service-name conf)

Search for sasl.kerberos.service.name is defined in either conf, System.properties its used, otherwise the default kafka name is used

Search for sasl.kerberos.service.name is defined in either conf, System.properties its used,
otherwise the default kafka name is used
raw docstring

MECHSclj


principal-nameclj

(principal-name ctx)

Return the unparsed principal name e.g kafka/broker1.kafkafast@KAFKAFAST A context can have multiple principals, this method returns the first principal found

Return the unparsed principal name e.g kafka/broker1.kafkafast@KAFKAFAST
A context can have multiple principals, this method returns the first principal found
raw docstring

readp-respclj

(readp-resp conn timeout-ms)

sasl-clientclj

(sasl-client conf ctx host)

See https://docs.oracle.com/javase/8/docs/api/javax/security/sasl/Sasl.html servicePrincipal: should be in the format kafka/{host} see kafka-principal-name host: the kafka broker

See https://docs.oracle.com/javase/8/docs/api/javax/security/sasl/Sasl.html
servicePrincipal: should be in the format kafka/{host} see kafka-principal-name
host: the kafka broker
raw docstring

sasl-handshake!clj

(sasl-handshake! conn
                 sasl-client
                 timeout-ms
                 &
                 {:keys [kafka-version] :or {kafka-version "0.10.0"}})

client: kafka-clj/tcp client sasl-client: jaas/sasl-client timeout-ms: timeout in milliseconds

client: kafka-clj/tcp client
sasl-client: jaas/sasl-client
timeout-ms: timeout in milliseconds
raw docstring

send-read-dataclj

(send-read-data conn client-resp should-read timeout-ms)

Write [int size][client-resp] then read [int size][server resp]

Write [int size][client-resp] then read [int size][server resp]
raw docstring

timeout?clj

(timeout? timeout-ms current-ms)

with-authclj

(with-auth ctx f)

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close