I am working to implement some webhooks. I understand how to use Servlets to handle the requests. I got it working using the following code (I got it from another thread on the forum, I don’t remember who to credit though):
String trustedClientPassword = AppBeans.get(Configuration.class).getConfig(WebAuthConfig.class).getTrustedClientPassword(); UserSession systemSession = AppBeans.get(TrustedClientService.class).getSystemSession(trustedClientPassword); SecurityContext securityContext = new SecurityContext(systemSession); SecurityContext previousSecurityContext = AppContext.getSecurityContext(); AppContext.setSecurityContext(securityContext);
However, I would like someway to have finer security controls. For example, if I have events coming in from Stripe vs events coming in from Mailgun, I’d like to apply different permissions depending if it comes from one or the other, really just to add that extra layer of security. I am unclear how to implement this. Any help would be appreciated.