harborctl icon indicating copy to clipboard operation
harborctl copied to clipboard

I can't log in to harbor (search working) - Harbor Version v1.7.1-c3806525

Open rurus9 opened this issue 7 years ago • 3 comments

Harbor Version v1.7.1-c3806525

cat conf/.harborctl.yaml

# harborctl configuration file (located at conf/ by default)
scheme: https
# specify harbor endpoint address
address: my.harbor.server

harborctl search -q=mariadb

==> GET https://my.harbor.server/api/search?q=mariadb
<== 
<== Rsp Status: 200 OK
<== Rsp Body: {
  "project": [],
  "repository": [
    {
      "project_id": 6,
      "project_name": "user",
      "project_public": true,
      "pull_count": 1,
      "repository_name": "user/mariadb",
      "tags_count": 1
    }
  ],
  "Chart": []
}

./harborctl login -u USER

Password: 
==> POST https://my.harbor.servel/login
<== Cookies: []
target cookies are not available

./harborctl systeminfo volume

==> GET https://harbor.abs.assecobs.pl/api/systeminfo/volumes
<== 
<== Rsp Status: 401 Unauthorized
<== Rsp Body: 

I've got harborctl from repo (go get -u github.com/moooofly/harborctl) today (2019-01-23) about 10am

rurus9 avatar Jan 23 '19 11:01 rurus9

Hi, @rurus9

Sorry for late reply, I will check this up.

It is more likely related to harbore version issue, because harbor changes dramatically between lastest release.

BTW, harborctl has been developed based on v1.6.0-66709daa

moooofly avatar Jan 25 '19 11:01 moooofly

Hi, @rurus9

After some digging, the conclusion as follow:

  • The login API changed from "/login" into "/c/login"
  • Some APIs that originally can be used without cookie setting, now must set
  • Use "beegonsessionID" before, use "sid" now

I will create a branch to trace v1.7.0, you can get the codes from there to use.

moooofly avatar Jan 27 '19 05:01 moooofly

OK, I am waiting for news ;)

rurus9 avatar Jan 31 '19 07:01 rurus9