Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OUTDATED: http/middleware directory, request middleware centralization, model list filtering #2698

Closed
wants to merge 34 commits into from

Conversation

dave-gray101
Copy link
Collaborator

@dave-gray101 dave-gray101 commented Jul 2, 2024

Middleware Refactor

This PR has a few goals, but is scoped strictly to avoid major functional changes:

  • Introduces core/http/middleware to hold http related code that's not endpoint specific
    -- metrics.go is pure file movement to live with the others.
    -- auth.go handles the creation of keyauth configuration data and contains the validation function.
    --- actual implementation of auth has been temporarily moved to my keyauth v2 backport - I submitted and merged the required feature changes to fiber upstream, but v3 is not quite yet stable enough for us to target... hence this backport.
    -- request.go contains a series of composable middlewares that are able to either extract user-provided information from the fiber context, or provide programmer suggested defaults. Later on, endpoints can retrieve these from fiber context Locals.
  • Plumbs through Application container to endpoints as needed. This is subject to future change as more services are created
  • Overhaul of ListModels and BackendConfig to add filtering capabilities, currently mostly used for setting defaults, but also drives some UI elements now.
    -- Currently reserved for the next PR but may end up here - plan to add a checkbox to UI to determine if "loose files" should appear in the dropdowns or not.

Copy link

netlify bot commented Jul 2, 2024

Deploy Preview for localai ready!

Name Link
🔨 Latest commit f5e6b68
🔍 Latest deploy log https://app.netlify.com/sites/localai/deploys/668d7dc9544919000876352b
😎 Deploy Preview https://deploy-preview-2698--localai.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Signed-off-by: Dave Lee <[email protected]>
Signed-off-by: Dave Lee <[email protected]>
@dave-gray101 dave-gray101 requested review from mudler, sozercan and cryptk and removed request for mudler July 2, 2024 16:37
@dave-gray101 dave-gray101 enabled auto-merge (squash) July 3, 2024 18:57
auto-merge was automatically disabled July 5, 2024 19:54

Pull Request is not mergeable

@dave-gray101 dave-gray101 enabled auto-merge (squash) July 6, 2024 01:05
@dave-gray101 dave-gray101 changed the title refactor: http/middleware directory, request middleware centralization, model list filtering OUTDATED: http/middleware directory, request middleware centralization, model list filtering Jul 16, 2024
auto-merge was automatically disabled October 12, 2024 23:02

Pull request was closed

@dave-gray101 dave-gray101 deleted the rf-middleware branch October 12, 2024 23:02
@dave-gray101 dave-gray101 restored the rf-middleware branch October 12, 2024 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant