MCPcopy
hub / github.com/cubefs/cubefs / ServeHTTP

Method ServeHTTP

authnode/http_server.go:79–109  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

77}
78
79func (m *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
80 log.LogInfof("URL[%v],remoteAddr[%v]", r.URL, r.RemoteAddr)
81 switch r.URL.Path {
82 case proto.ClientGetTicket:
83 m.getTicket(w, r)
84 case proto.AdminCreateKey:
85 fallthrough
86 case proto.AdminGetKey:
87 fallthrough
88 case proto.AdminDeleteKey:
89 fallthrough
90 case proto.AdminAddCaps:
91 fallthrough
92 case proto.AdminDeleteCaps:
93 fallthrough
94 case proto.AdminGetCaps:
95 m.apiAccessEntry(w, r)
96 case proto.AdminAddRaftNode:
97 fallthrough
98 case proto.AdminRemoveRaftNode:
99 m.raftNodeOp(w, r)
100 case proto.OSAddCaps:
101 fallthrough
102 case proto.OSDeleteCaps:
103 fallthrough
104 case proto.OSGetCaps:
105 m.osCapsOp(w, r)
106 default:
107 sendErrReply(w, r, &proto.HTTPAuthReply{Code: proto.ErrCodeParamError, Msg: "Invalid requst URL"})
108 }
109}
110
111func (m *Server) handleFunctions() {
112 http.HandleFunc(proto.ClientGetTicket, m.getTicket)

Callers 15

auditMiddlewareMethod · 0.45
traceMiddlewareMethod · 0.45
authMiddlewareMethod · 0.45
policyCheckMiddlewareMethod · 0.45
contentMiddlewareMethod · 0.45
expectMiddlewareMethod · 0.45
corsMiddlewareMethod · 0.45
proxyMethod · 0.45
createMasterServerFunction · 0.45
registerAPIMiddlewareMethod · 0.45

Calls 6

getTicketMethod · 0.95
apiAccessEntryMethod · 0.95
raftNodeOpMethod · 0.95
osCapsOpMethod · 0.95
LogInfofFunction · 0.92
sendErrReplyFunction · 0.70

Tested by 1

createMasterServerFunction · 0.36