projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
20200: Add limiter for log create requests
[arvados.git]
/
sdk
/
go
/
arvados
/
login.go
diff --git
a/sdk/go/arvados/login.go
b/sdk/go/arvados/login.go
index 26c04b2c13603a2a7c9aa721b38a1fd5343c5228..ab7637546289a659651c9648907b0558cfe1c064 100644
(file)
--- a/
sdk/go/arvados/login.go
+++ b/
sdk/go/arvados/login.go
@@
-6,14
+6,11
@@
package arvados
import (
"bytes"
import (
"bytes"
- "encoding/json"
"net/http"
)
type LoginResponse struct {
RedirectLocation string `json:"redirect_location,omitempty"`
"net/http"
)
type LoginResponse struct {
RedirectLocation string `json:"redirect_location,omitempty"`
- Token string `json:"token,omitempty"`
- Message string `json:"message,omitempty"`
HTML bytes.Buffer `json:"-"`
}
HTML bytes.Buffer `json:"-"`
}
@@
-22,12
+19,6
@@
func (resp LoginResponse) ServeHTTP(w http.ResponseWriter, req *http.Request) {
if resp.RedirectLocation != "" {
w.Header().Set("Location", resp.RedirectLocation)
w.WriteHeader(http.StatusFound)
if resp.RedirectLocation != "" {
w.Header().Set("Location", resp.RedirectLocation)
w.WriteHeader(http.StatusFound)
- } else if resp.Token != "" || resp.Message != "" {
- w.Header().Set("Content-Type", "application/json")
- if resp.Token == "" {
- w.WriteHeader(http.StatusUnauthorized)
- }
- json.NewEncoder(w).Encode(resp)
} else {
w.Header().Set("Content-Type", "text/html")
w.Write(resp.HTML.Bytes())
} else {
w.Header().Set("Content-Type", "text/html")
w.Write(resp.HTML.Bytes())
@@
-35,7
+26,7
@@
func (resp LoginResponse) ServeHTTP(w http.ResponseWriter, req *http.Request) {
}
type LogoutResponse struct {
}
type LogoutResponse struct {
- RedirectLocation string
+ RedirectLocation string
`json:"redirect_location,omitempty"`
}
func (resp LogoutResponse) ServeHTTP(w http.ResponseWriter, req *http.Request) {
}
func (resp LogoutResponse) ServeHTTP(w http.ResponseWriter, req *http.Request) {