refactor: replace base64url with hex encoding in token generation#400
Draft
refactor: replace base64url with hex encoding in token generation#400
Conversation
Co-authored-by: venkatamutyala <6570292+venkatamutyala@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update generateCdeToken function to use hex encoding
Replace base64url with hex encoding in generateCdeToken
Feb 3, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR replaces base64url encoding with hex encoding for CDE token generation to eliminate special characters (-, _) and simplify token handling. The change reduces entropy from 256 bits to 172 bits while maintaining cryptographic security.
Changes:
- Modified token generation from
crypto.randomBytes(32).toString('base64url')tocrypto.randomBytes(22).toString('hex').slice(0, 43) - Updated documentation to reflect hex character set (0-9, a-f) instead of base64url
- Token length remains 43 characters
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot
AI
changed the title
Replace base64url with hex encoding in generateCdeToken
refactor: replace base64url with hex encoding in token generation
Feb 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Token generation used base64url encoding, producing special characters (
-,_) that complicate downstream handling.Changes
crypto.randomBytes(32).toString('base64url')withcrypto.randomBytes(22).toString('hex').slice(0, 43)[A-Za-z0-9_-]to[0-9a-f]Files Modified
util/token-generator.jsWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/GlueOps/slackbot-developer-workspaces/pulls/400/commits/usr/bin/curl curl -s -H Accept: application/vnd.github.v3+json REDACTED(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
This pull request was created from Copilot chat.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.