Ollama4j
A Java library (wrapper/binding) for Ollama server.
Loading...
Searching...
No Matches
BasicAuth.java
Go to the documentation of this file.
1package io.github.ollama4j.models.request;
2
3import lombok.AllArgsConstructor;
4import lombok.Data;
5import lombok.EqualsAndHashCode;
6
7import java.util.Base64;
8
9@Data
10@AllArgsConstructor
11@EqualsAndHashCode(callSuper = false)
12public class BasicAuth extends Auth {
13 private String username;
14 private String password;
15
21 public String getAuthHeaderValue() {
22 final String credentialsToEncode = this.getUsername() + ":" + this.getPassword();
23 return "Basic " + Base64.getEncoder().encodeToString(credentialsToEncode.getBytes());
24 }
25}