Add Swift login endpoint (#32693)
Fix #32683 This PR adds the login endpoint and fixes the documentation links. (cherry picked from commit 136408307c6de7aac2ab5476f8cddf90f39355dc) Conflicts: routers/api/packages/api.go trivial context conflicts
This commit is contained in:
parent
48131547a1
commit
0786ddc5de
3 changed files with 76 additions and 42 deletions
|
@ -43,6 +43,24 @@ func TestPackageSwift(t *testing.T) {
|
|||
|
||||
url := fmt.Sprintf("/api/packages/%s/swift", user.Name)
|
||||
|
||||
t.Run("CheckLogin", func(t *testing.T) {
|
||||
defer tests.PrintCurrentTest(t)()
|
||||
|
||||
req := NewRequestWithBody(t, "POST", url, strings.NewReader(""))
|
||||
MakeRequest(t, req, http.StatusUnauthorized)
|
||||
|
||||
req = NewRequestWithBody(t, "POST", url, strings.NewReader("")).
|
||||
AddBasicAuth(user.Name)
|
||||
MakeRequest(t, req, http.StatusOK)
|
||||
|
||||
req = NewRequestWithBody(t, "POST", url+"/login", strings.NewReader(""))
|
||||
MakeRequest(t, req, http.StatusUnauthorized)
|
||||
|
||||
req = NewRequestWithBody(t, "POST", url+"/login", strings.NewReader("")).
|
||||
AddBasicAuth(user.Name)
|
||||
MakeRequest(t, req, http.StatusOK)
|
||||
})
|
||||
|
||||
t.Run("CheckAcceptMediaType", func(t *testing.T) {
|
||||
defer tests.PrintCurrentTest(t)()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue