All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.malliina.logstreams.client.HttpUtil.scala Maven / Gradle / Ivy

There is a newer version: 2.8.2
Show newest version
package com.malliina.logstreams.client

import java.util.Base64

object HttpUtil {
  val Authorization = "Authorization"

  def basicAuth(username: String, password: String): KeyValue =
    KeyValue(HttpUtil.Authorization, authorizationValue(username, password))

  def authorizationValue(username: String, password: String) =
    "Basic " + Base64.getEncoder.encodeToString(s"$username:$password".getBytes("UTF-8"))
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy