MCPcopy
hub / github.com/mudler/LocalAI / GetSource

Function GetSource

core/http/auth/middleware.go:228–231  ·  view source on GitHub ↗

GetSource returns the request's authentication source: UsageSourceAPIKey, UsageSourceWeb, UsageSourceLegacy, or empty if no authentication was performed.

(c echo.Context)

Source from the content-addressed store, hash-verified

226// GetSource returns the request's authentication source: UsageSourceAPIKey,
227// UsageSourceWeb, UsageSourceLegacy, or empty if no authentication was performed.
228func GetSource(c echo.Context) string {
229 s, _ := c.Get(contextKeySource).(string)
230 return s
231}
232
233// RequireRouteFeature returns a global middleware that checks the user has access
234// to the feature required by the matched route. It uses the RouteFeatureRegistry

Callers 2

UsageMiddlewareFunction · 0.92
middleware_test.goFile · 0.92

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected