-
Notifications
You must be signed in to change notification settings - Fork 8
Add Auditlog to call core endpoints #302
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
Conversation
| router.route().failureHandler(new GenericFailureHandler()); | ||
|
|
||
| final boolean enableAuditLog = true; | ||
| final AuditParams auditParams = new AuditParams(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why? isn't it better to have 1 less parm in constructor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed this by overloading function 'handleWithAudit' to accept fewer arguments
| router.get(Endpoints.CLOUD_ENCRYPTION_KEYS_RETRIEVE.toString()).handler(auth.handleWithAudit(attestationMiddleware.handle(this::handleCloudEncryptionKeysRetrieval), auditParams, enableAuditLog, Role.OPERATOR)); | ||
| router.get(Endpoints.SITES_REFRESH.toString()).handler(auth.handleWithAudit(attestationMiddleware.handle(this::handleSiteRefresh), auditParams, enableAuditLog, Role.OPERATOR)); | ||
| router.get(Endpoints.KEY_REFRESH.toString()).handler(auth.handleWithAudit(attestationMiddleware.handle(this::handleKeyRefresh), auditParams, enableAuditLog, Role.OPERATOR)); | ||
| router.get(Endpoints.KEY_ACL_REFRESH.toString()).handler(auth.handleWithAudit(attestationMiddleware.handle(this::handleKeyAclRefresh), auditParams, enableAuditLog, Role.OPERATOR)); | ||
| router.get(Endpoints.KEY_KEYSET_REFRESH.toString()).handler(auth.handleWithAudit(attestationMiddleware.handle(this::handleKeysetRefresh), auditParams, enableAuditLog, Role.OPERATOR)); | ||
| router.get(Endpoints.KEY_KEYSET_KEYS_REFRESH.toString()).handler(auth.handleWithAudit(attestationMiddleware.handle(this::handleKeysetKeyRefresh), auditParams, enableAuditLog, Role.OPERATOR)); | ||
| router.get(Endpoints.SALT_REFRESH.toString()).handler(auth.handleWithAudit(attestationMiddleware.handle(this::handleSaltRefresh), auditParams, enableAuditLog, Role.OPERATOR)); | ||
| router.get(Endpoints.CLIENTS_REFRESH.toString()).handler(auth.handleWithAudit(attestationMiddleware.handle(this::handleClientRefresh), auditParams, enableAuditLog, Role.OPERATOR)); | ||
| router.get(Endpoints.CLIENT_SIDE_KEYPAIRS_REFRESH.toString()).handler(auth.handleWithAudit(attestationMiddleware.handle(this::handleClientSideKeypairRefresh), auditParams, enableAuditLog, Role.OPERATOR)); | ||
| router.get(Endpoints.SERVICES_REFRESH.toString()).handler(auth.handleWithAudit(attestationMiddleware.handle(this::handleServiceRefresh), auditParams, enableAuditLog, Role.OPERATOR)); | ||
| router.get(Endpoints.SERVICE_LINKS_REFRESH.toString()).handler(auth.handleWithAudit(attestationMiddleware.handle(this::handleServiceLinkRefresh), auditParams, enableAuditLog, Role.OPERATOR)); | ||
| router.get(Endpoints.OPERATORS_REFRESH.toString()).handler(auth.handleWithAudit(attestationMiddleware.handle(this::handleOperatorRefresh), auditParams, enableAuditLog, Role.OPTOUT_SERVICE)); | ||
| router.get(Endpoints.PARTNERS_REFRESH.toString()).handler(auth.handleWithAudit(attestationMiddleware.handle(this::handlePartnerRefresh), auditParams, enableAuditLog, Role.OPTOUT_SERVICE)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is getting harder to read. We should move away from the pattern where handlers have inner handlers. The next handler is already available on the routing context. It would be better to split it up like this
router.get(Endpoints.SITES_REFRESH.toString())
.handler(auth.handleWithAudit(auditParams, enableAuditLog, Role.OPERATOR))
.handler(attestationMiddleware::handle)
.handler(this::handleSiteRefresh);There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. Perhaps we do it as part of continuous improvement
|
|
||
| private final FileSystem fileSystem; | ||
|
|
||
| private static final String OPERATOR_TYPE = "operator_type"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Maybe name it something like OPERATOR_TYPE_QUERY_PARAM_NAME otherwise it's a bit confusing 🤔
No description provided.