JuliaAI / MLFlowClient.jl

Julia client for MLFlow.
https://juliaai.github.io/MLFlowClient.jl/
MIT License
47 stars 10 forks source link

Authenticating via REST API #33

Open mashu opened 1 year ago

mashu commented 1 year ago

Hi, in the examples I see that it's possible to pass some dictionary with Authentication token, does that mean authentication is supported? if I dont have basic-auth set, the instance gets hacked. So it would be good to have.

dpaetzel commented 11 months ago

Which examples do you refer to? I would also be very interested in authentication support; unfortunately, I can't invest a lot of time right now, though …

mashu commented 11 months ago

@dpaetzel I figured it works by just starting mlflow with authentication

mlflow server --app-name basic-auth

changing password ASAP

then logging as follow, where I use TOML file to store username and password

using Base64
using TOML
using MLFlowClient
# Create MLFlow instance
config = open("config.toml", "r") do file
    TOML.parse(read(file, String))
end
username = config["database"]["user"]
password = config["database"]["password"]
encoded_credentials = base64encode("$username:$password")
headers = Dict("Authorization" => "Basic $encoded_credentials")
mlf = MLFlow(mlflow_url, headers=headers)
dpaetzel commented 11 months ago

Awesome, thank you! :relaxed:

pebeto commented 10 months ago

@deyandyankov, could an authorization parameter be considered in the future? This can be an usability upgrade.