Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

zone.cogni.lib.vinz-clortho:vinz-clortho

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zone.cogni.lib.vinz-clortho:vinz-clortho

A lightweight replacement for Zuul when using spring boot 2.7+

  • 2.0.0
  • Source
  • Maven
  • Socket score

Version published
Maintainers
1
Source

Vinz Clortho

A lightweight replacement for Zuul when using spring boot 2.7+

Get started

In your code just add the @EnableVinzClorthoProxy annotation on any @Configuration class. Then setup the routing configuration like this:

cognizone:
  vinz:
    routes:
      - name: firstRoute   # just a name, make it unique, nothing else special here 
        path: /proxy/route1/**  # the path on your server (if you use a servlet context path, this will be the part after the context path) 
        url: http://example.com/route1  # The destination url to proxy to
      - name: secondRoute
        path: /proxy/route2/**
        url: http://example.com/route2
        headers:
          response-set:
            - key: Access-Control-Allow-Headers
              value: "*"
              filter: "#{[request].getHeader('Origin') != null}"

That's it, you're all set.

What's supported

Altering the body of the Request

Create a spring bean implementing cogni.zone.vinzclortho.BodyEditor. If such a bean exists, it will be called with the original HttpRequest and content body as an InputStream, so you can change the content of the request body. The new body has to be returned as a org.apache.http.HttpEntity object.

Validate if a Request is allowed

Create a spring bean implementing cogni.zone.vinzclortho.RequestValidator. If such a bean exists, it will be called with the original request information. If you return a non-null value, that value with be used to send the response and no proxying will be done.

HTTP methods

At the moment following HTTP methods are supported: GET, POST, PUT, DELETE

Headers

Follow headers will be passed from the original request:

  • Accept
  • Accept-Language
  • Content-Type
  • User-Agent

After the proxied request, following response headers will be sent back to the client:

  • Content-Type

In the example above Access-Control-Allow-Headers: * will be added to the response of secondRoute in case the filter matches. The filter should be a spel expression that returns a boolean. In this example (#{[request].getHeader('Origin') != null}) the header will be set if the original request contains an Origin header.

FAQs

Package last updated on 30 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc