Comments (9)
It was removed because authentication is not a primary concern of a health check library. The health check handler is just a standard http.Handler though, so you can use it with many middleware implementations, such as this or this .
from health.
Yes, but it's still useful to be able to return a more limited result to non-authenticated clients, instead of returning a 401 or 403. I can implement a middleware calling two different health handlers based on auth status, but in that case I'd have two separate but similar/identical copies of health checkers running in background, no?
from health.
Ah, I understand. Yes, this functionality was removed. As a replacement, I planned to add a more generic function to disable details on a request basis. This way you can decide in which situations you would like to disable details yourself. To do this, you would need to add a marker to the request context by calling a health.DisableResponseDetails(request.Context())
function whenever you want to return the reduced response. This could be called by your middleware. Would this be sufficient for you? This is just a rough sketch, I'm open for other ideas.
from health.
The marker/option would be nice. I was also thinking of separating and exposing the checks machinery from the handler(s), thus also allowing to further customize the output and the strategy of handling. I've seen this approach adopted in hellofresh/health-go for example. What would you think?
from health.
I've provided an implementation in panta/feature/standalone-checkers (just a matter of making the checker
-> Checker
interface public, add a NewChecker()
function, and some other very minor adjustments).
If you feel this might be useful to others I'll send a PR.
from health.
Thanks. I looks interesting, indeed! Happy to get a PR for this. I'll look into it tonight.
from health.
Merged with #5
from health.
In case you're still interested in a solution: The new version 0.5.0 has a BasicAuth middleware that should do what you want.
from health.
Actually I need to use it with a different auth mechanism, but the stand-alone checkers are perfect for that!
Thanks!
from health.
Related Issues (20)
- Make health check results consumable by Prometheus HOT 4
- Add TCP Dial check HOT 4
- ADD HTTP check HOT 2
- Add goroutine count check HOT 1
- Add garbage collection max pause check HOT 4
- Add DNS resolve check
- Add Postgres check HOT 1
- Add MySQL check HOT 3
- Add Elasticsearch check HOT 2
- Add Redis check HOT 1
- Add Kafka Consumer check HOT 2
- Add Kafka producer check HOT 2
- Add Memcached check
- Add GRPC check HOT 2
- Add Mongo DB check HOT 2
- Add disk space check HOT 1
- Add SMTP server health check HOT 3
- Add IMAP server health check HOT 2
- Add panic recovery mechanism HOT 3
- Make health check runnable by name HOT 10
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 health.