@@ -109,9 +109,8 @@ func (c wsConn) readMessage() (messageType int, p []byte, err error) {
109
109
//
110
110
// TODO: Enable CORS
111
111
func serveWS (w http.ResponseWriter , req * http.Request ) {
112
- // authenticate WS connection
113
- // TODO: use this claims to create the adminClient
114
- _ , err := ws .Authenticate (req )
112
+ // authenticate WS connection with MCS
113
+ claims , err := ws .Authenticate (req )
115
114
if err != nil {
116
115
log .Print ("error on ws authentication: " , err )
117
116
errors .ServeError (w , req , err )
@@ -126,13 +125,9 @@ func serveWS(w http.ResponseWriter, req *http.Request) {
126
125
return
127
126
}
128
127
129
- // TODO: CHANGE ! to use newMAdminClient once Assume Role is
130
- // allowed to do Trace use jwt on ws.
131
-
132
- // Using newSuperMAdminClient in the meantime for sake of functionality
133
128
// Only start Websocket Interaction after user has been
134
- // authenticated.
135
- mAdmin , err := newSuperMAdminClient ( )
129
+ // authenticated with MinIO
130
+ mAdmin , err := newAdminFromClaims ( claims )
136
131
if err != nil {
137
132
log .Println ("error creating Madmin Client:" , err )
138
133
errors .ServeError (w , req , err )
0 commit comments