include backfill method and exact function run - #1751
Conversation
| return make_response("No user found with that email address", 404) | ||
| existing_roles = {role.name for role in user.roles} | ||
| User.update_user(user=user, api_key=user_api_key, email=user_email, roles=existing_roles, session=session) | ||
| return make_response(f"Successfully replaced API key for {user_email}", 200, {"Content-Type": "text/plain"}) |
|
| var latestResponse = allResponses[allResponses.length - 1]; | ||
|
|
||
| var user_api_key = Math.random().toString(16).substr(2, 18); | ||
| var user_api_key = Utilities.getUuid().replace(/-/g, ''); |
There was a problem hiding this comment.
This seems like a core change to the key gen algorithm. Is that intended?
There was a problem hiding this comment.
that was mollifying sonarcloud
There was a problem hiding this comment.
...so we're changing our user key gen algo to appease a linter?
There was a problem hiding this comment.
It's not a linter, its a security check, and it is right about it. I don't think this is a big deal to change
| noReply: true, | ||
| body: ` | ||
| API Key was not generated. | ||
| Logger.log('Email already registered, replacing key for %s', user_email); |
There was a problem hiding this comment.
suggestion (non-blocking): this code block is reused a couple times that it might be worth turning it into a function, where the email body is an argument. And then you could mock that function out for dry run testing, if needed
|
This sonarcloud code analysis is way too loud and noisy for the level of comments it generates (const var vs var is really not a code red emergency). If you find some way to be able to read a gh pr diff without that stuff inline, I'd be happy to hear about it |



Summary:
Adds a backfill method to the API script in case the script is ever turned off
Prerequisites:
devbranchdev