Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

login returns "Login Succeeded" even if it's wrong credentials #3238

Open
rahulranjan937 opened this issue Mar 21, 2024 · 0 comments
Open

login returns "Login Succeeded" even if it's wrong credentials #3238

rahulranjan937 opened this issue Mar 21, 2024 · 0 comments

Comments

@rahulranjan937
Copy link

Expected response

Docker login to return a failure message.

Actual response

Docker login prints a success message.

"Here is the code that I used to log in:"

async def login_registry_hub(username: str,password: str, registry_url: str):
    try:
        res = client.login(
            registry=LoginRegistryHub.registry_url,
            username=LoginRegistryHub.username,
            password=LoginRegistryHub.password,
        )
        return {"message": "Login successful" if res.get("Status") == "Login Succeeded" else "Login failed"}
    except docker.errors.APIError as e:
        return {"error": str(e)}

Expected response

{
    "message": "Login successful",
    "response": {
        "username": "username",
        "password": "token",
        "email": null,
        "serveraddress": "https://ghcr.io" 
    }
}

Actual response

 {
    "message": "Login successful",
    "response": {
        "IdentityToken": "",
        "Status": "Login Succeeded"
    }
}

docker version:

~ > docker version                                                                                                                
Client:
 Cloud integration: v1.0.35+desktop.11
 Version:           25.0.3
 API version:       1.44
 Go version:        go1.21.6
 Git commit:        4debf41
 Built:             Tue Feb  6 21:13:26 2024
 OS/Arch:           darwin/arm64
 Context:           desktop-linux

Server: Docker Desktop 4.28.0 (139021)
 Engine:
  Version:          25.0.3
  API version:      1.44 (minimum version 1.24)
  Go version:       go1.21.6
  Git commit:       f417435
  Built:            Tue Feb  6 21:14:22 2024
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.6.28
  GitCommit:        ae07eda36dd25f8a1b98dfbf587313b99c0190bb
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant