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

feature: Events #297

Open
gedw99 opened this issue Nov 9, 2023 · 3 comments
Open

feature: Events #297

gedw99 opened this issue Nov 9, 2023 · 3 comments
Assignees

Comments

@gedw99
Copy link

gedw99 commented Nov 9, 2023

A clear and concise description of what you want the system to do.

Messaging Providers Is ok, but it would be good if the system can emit web hook style events.

The use case, is to allow the system to be integrated in various ways. Say you want to track things in terms of analytics or you want to implement custom logic around User signups into other sub systems.

Caddy Security can't possibly cater to all the whims of use cases and this is a way for developers to be able to extend from what's there.

What are the Caddyfile directives that need to be added.

I think that adding http paths to the existing Caddy file make sense.

Where they are depends but a liberal sprinkling is decent

other considerations

I chose web hooks because it's just so generic. If a developer has a Message broker or whatever they can just wrap it with http to receive the payload and pass it into their preferred Message Broker.

There is also a use case Caddy Security also being able to respond to external events. For example to delete a Use or to change the Groups that a user is in, and a myriad of other aspects that Caddy Security Caters for.

As I write this, it's really starting to look like an API into Caddy Security to a degree, which I was hoping to avoid :)

@greenpau
Copy link
Owner

greenpau commented Nov 9, 2023

Messaging Providers Is ok, but it would be good if the system can emit web hook style events.

@gedw99 , can it be a separate plugin that attached itself to caddy's logging subsystem?

for reference: https://github.com/caddyserver/caddy/blob/3b3d67871446ee6bf1921938ef0f16b6112c7ceb/modules/logging/filters.go

@gedw99
Copy link
Author

gedw99 commented Nov 10, 2023

That's an interesting solution. Sort of like doing CDC on a DB.

I have not messed around with Caddy logging enough to know, but logically that could work quite nicely.

Does Caddy Security namespace its loging so that we can easily isolate Caddy Security logs ?

Then we would need to write, Or hunt for a plug that probably exists int he GitHub ether, to publish the relevant events out from there .

@greenpau
Copy link
Owner

greenpau commented Dec 2, 2023

Does Caddy Security namespace its loging so that we can easily isolate Caddy Security logs ?

@gedw99 , I don't know the answer. Caddy's logs are zap logs. This plugin also uses zap. Perhaps, there is a way to intercept/hook into all zap loggers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants