Comments (3)
That was exactly my question, thank you for the quick response!
We thought about a wrapper function of New
, let's say NewWithAuthorizer
, where the user can pass an implementation of an Authorizer
interface or something like that, but that would work only for our particular use case (however, if you like the idea, we'll be glad to contribute it).
If we pass user-provided middlewares instead, a problem would be their order, so the already present approach with adding them manually looks more suitable.
Adding them at the end is also possible at the moment, since New
returns a router.
If we think of anything that could possibly solve that, we'll be happy to share it.
Thanks again!
from brokerapi.
We have created an issue in Pivotal Tracker to manage this:
https://www.pivotaltracker.com/story/show/168801074
The labels on this github issue will be updated when the story is started.
from brokerapi.
Hi @desislavaa,
Just to guarantee that we understand your question:
You want to implement a custom auth middleware and reuse all the other broker middlewares (as defined here). That means that in your code you would have a function similar to brokerapi.New
, just changing the auth middleware to your custom implementation. Your question is whether or not this is a good idea/recommended?
If so, yes. Feel free to reuse the broker middlewares. That's actually why we have AttachRoutes
as a public method.
We would also be curious to hear if you have any ideas on how to make it easier for users of the brokerapi to provide custom middlewares.
Let us know if you need further help.
Thanks!
from brokerapi.
Related Issues (20)
- Binding struct is missing support for Endpoint? HOT 4
- Audit log by the APIHandler type HOT 3
- Missing metadata field in ProvisionedServiceSpec HOT 4
- Missing allow_context_updates field HOT 7
- Unversioned handlers shouldn't not use versioned domain/apiresponses HOT 2
- Use of authentication methods other than Basic Auth HOT 6
- v8 backwards compatiblity HOT 7
- Is the FailureResponse status code used? HOT 4
- test issgu HOT 1
- Incorrect type for metadata fields in Get/Provision/Deprovision responses HOT 3
- Broker does not accept url-encoded forward slash in instance_id HOT 6
- Ability to implement custom ServicePlanCost? HOT 1
- Feature request: Simple way to add prometheus exporter HOT 3
- Support for Binding rotation HOT 3
- Requirement to expose additional API endpoints HOT 3
- Setting CF labels not supported? HOT 4
- Use chi.Router interface for AttachRoutes method HOT 3
- for v11: NewFailureResponse() should return error not *apiresponses.FailureResponse HOT 3
- Replace lager.Logger with log/slog.Logger HOT 4
- Possibility to register a custom middle ware HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from brokerapi.