add auth callbacks
@@ -99,9 +99,10 @@ async fn main() -> Result<(), String> {
api.register(listen_airtable_shipments_outbound_schedule_pickup_webhooks).unwrap();
api.register(listen_airtable_swag_inventory_items_print_barcode_labels_webhooks).unwrap();
api.register(listen_analytics_page_view_webhooks).unwrap();
+ api.register(listen_auth_docusign_callback).unwrap();
+ api.register(listen_auth_gusto_callback).unwrap();
+ api.register(listen_auth_quickbooks_callback).unwrap();
api.register(listen_checkr_background_update_webhooks).unwrap();
- api.register(listen_docusign_callback).unwrap();
- api.register(listen_quickbooks_callback).unwrap();
api.register(listen_docusign_envelope_update_webhooks).unwrap();
api.register(listen_google_sheets_edit_webhooks).unwrap();
api.register(listen_google_sheets_row_create_webhooks).unwrap();
@@ -1205,16 +1206,31 @@ pub struct AuthCallback {
pub realm_id: String,
}
+/** Listen for callbacks to Gusto auth. */
+#[endpoint {
+ method = GET,
+ path = "/auth/gusto/callback",
+}]
+async fn listen_auth_gusto_callback(_rqctx: Arc<RequestContext<Context>>, query_args: Query<AuthCallback>) -> Result<HttpResponseAccepted<String>, HttpError> {
+ sentry::start_session();
+ let event = query_args.into_inner();
+
+ sentry::capture_message(&format!("auth gusto callback: {:?}", event), sentry::Level::Info);
+
+ sentry::end_session();
+ Ok(HttpResponseAccepted("ok".to_string()))
+}
+
/** Listen for callbacks to QuickBooks auth. */
#[endpoint {
method = GET,
- path = "/quickbooks/callback",
+ path = "/auth/quickbooks/callback",
}]
-async fn listen_quickbooks_callback(_rqctx: Arc<RequestContext<Context>>, query_args: Query<AuthCallback>) -> Result<HttpResponseAccepted<String>, HttpError> {
+async fn listen_auth_quickbooks_callback(_rqctx: Arc<RequestContext<Context>>, query_args: Query<AuthCallback>) -> Result<HttpResponseAccepted<String>, HttpError> {
sentry::start_session();
let event = query_args.into_inner();
- sentry::capture_message(&format!("quickbooks callback: {:?}", event), sentry::Level::Info);
+ sentry::capture_message(&format!("auth quickbooks callback: {:?}", event), sentry::Level::Info);
sentry::end_session();
Ok(HttpResponseAccepted("ok".to_string()))
@@ -1223,13 +1239,13 @@ async fn listen_quickbooks_callback(_rqctx: Arc<RequestContext<Context>>, query_
/** Listen for callbacks to docusign auth. */
#[endpoint {
method = GET,
- path = "/docusign/callback",
+ path = "/auth/docusign/callback",
}]
-async fn listen_docusign_callback(_rqctx: Arc<RequestContext<Context>>, query_args: Query<AuthCallback>) -> Result<HttpResponseAccepted<String>, HttpError> {
+async fn listen_auth_docusign_callback(_rqctx: Arc<RequestContext<Context>>, query_args: Query<AuthCallback>) -> Result<HttpResponseAccepted<String>, HttpError> {
sentry::start_session();
let event = query_args.into_inner();
- sentry::capture_message(&format!("docusign callback: {:?}", event), sentry::Level::Info);
+ sentry::capture_message(&format!("auth docusign callback: {:?}", event), sentry::Level::Info);
sentry::end_session();
Ok(HttpResponseAccepted("ok".to_string()))
