Skip to content

Conversation

@stephenhand
Copy link
Collaborator

@stephenhand stephenhand commented Nov 28, 2025

Description

Follows on from #3726 by implementing our own auth backend in the account scoped lambda.

It adds an auth mechanism for endpoints restricted to 'guest' webchat users, and allows routes using the helpline short code (because new webchat hides account SIDs from users)

Checklist

  • Corresponding issue has been opened
  • New tests added
  • Feature flags added
  • Strings are localized
  • Tested for chat contacts
  • Tested for call contacts

Other Related Issues

None

Verification steps

AFTER YOU MERGE

  1. Cut a release tag using the Github workflow. Wait for it to complete and notify in the #aselo-deploys Slack channel.
  2. Comment on the ticket with the release tag version AND any additional instructions required to configure an environment to test the changes.
  3. Only then move the ticket into the QA column in JIRA

You are responsible for ensuring the above steps are completed. If you move a ticket into QA without advising what version to test, the QA team will assume the latest tag has the changes. If it does not, the following confusion is on you! :-P

Copy link
Collaborator

@gpaoloni gpaoloni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard for me to distinguish what is the original React app that we are basing off and what is the custom code being added, so I don't think I can make useful comments on this one
EDIT: Sorry this was intended to go in #3726 🤦‍♂️

Copy link
Collaborator

@gpaoloni gpaoloni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! I tried accessing hrm with the token generated here and it does not grants access

tokenResult {
  "_tag": "Result",
  "status": "error",
  "message": "Invalid token provided",
  "error": "Invalid Access Token grants"
}

};
};

export const newJsErrorResult = <TError extends Error>(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this the same as newErr({ message: error.message, error })?

Comment on lines +113 to +120
'webchatAuth/initWebchat': {
requestPipeline: [],
handler: initWebchatHandler,
},
'webchatAuth/refreshToken': {
requestPipeline: [],
handler: refreshTokenHandler,
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these needed in both. here and in ENV_SHORTCODE_ROUTES?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants