Open ccrvlh opened 2 years ago
I guess this could be implemented with a series of extensions methods, somewhat similar to what already exists for the floating ip resource.
Probably the biggest design decision here is whether to use a similar approach as the one used for EC2 security groups, in which rules and sources are being handled directly on a method, or to go with an object-first approach and make a new object for rules/sources (the two nested objects that DOs firewall uses).
Maybe making it closer to EC2 could be a good idea: if there was a strong enough argument to make firewall part of the core (non ex) lib in the future, the APIs would already be similar. With this directive I would be happy to start working on this.
@lowercase00 That approach reasonable to me.
It's also worth noting that some APIs (e.g. storage) support both approaches - driver methods call object methods or vice versa.
So the object approach is really just a convenience.
Thanks @Kami, I'll push a few commits to my local fork before a PR and let you know how things evolve
I couldn't find DigitalOcean's firewall feature. I can start working on it right away. Would it make sense for PR? Thanks!