ServiceNowDevProgram / SlackerBot

The official application repository for the bot @Slacker on the sndevs.com workspace.
https://github.com/ServiceNowDevProgram/Hacktoberfest
10 stars 78 forks source link

Remove all the scoped app token properties #151

Open earlduque opened 1 year ago

earlduque commented 1 year ago

To safeguard users from accidentally getting their tokens disabled

The following must occur together for this issue to be resolved:

chelming commented 1 year ago

Maybe a fix script that creates the properties? I'm wondering what the easiest way would be to "set it up" 🤔

Perhaps a new UI action that pops a modal with those properties? "Set up bot"

johndahl-now commented 1 year ago

Are there any parsers that directly access the token? They should all be calling the Slacker script include, which in turn retrieves the token.

Should the global property be protected with read (bot) and write (admin) roles? I'm not sure if that matters on the sndevprogram instance, but good practice is good practice.

chelming commented 1 year ago

yes. there ~are~ is.

~/git/SlackerBot/Parsers$ grep -rn 'getProperty' .
./Admin tool - Whois.js:12:  rm.setRequestHeader('authorization', 'Bearer '+gs.urlEncode(gs.getProperty('x_snc_slackerbot.SlackerBot.token')));
./Admin tool - Whois.js:14://   bodyString += 'token=' + gs.urlEncode(gs.getProperty('x_snc_slackerbot.SlackerBot.token'));
johndahl-now commented 1 year ago

oh, those are just the admin tools...figures they would violate best practices and coding standards. Who do they think they are? 🤷

earlduque commented 1 year ago

not a dig at me, i'm not an admin :P