Skip to content

Commit

Permalink
Fix secure storage issuing
Browse files Browse the repository at this point in the history
  • Loading branch information
greeeen-dev committed Feb 5, 2025
1 parent 9a361d0 commit e20acee
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion cogs/sysmgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,20 @@ def allow_storage(plugin, cog):
failed.update({child_cog: 'Could not run pre-unload script.'})
elif cog_exists:
toload.append(f'cogs.{cog}')
cog_clean = cog+'.py' if not cog.endswith('.py') else cog

for plugin in os.listdir('plugins'):
if not plugin.endswith('.json'):
continue

with open('plugins/' + plugin) as file:
pluginfo = json.load(file)

if cog_clean in pluginfo['modules']:
if cog_clean in pluginfo.get('uses_tokenstore', []):
allow_tokenstore(plugin[:-5], f'cogs.{cog}')
if cog_clean in pluginfo.get('uses_storage', []):
allow_storage(plugin[:-5], f'cogs.{cog}')
else:
toload.append(f'cogs.{cog}')
skip.append(f'cogs.{cog}')
Expand Down Expand Up @@ -1080,7 +1094,7 @@ def allow_storage(plugin, cog):
for plugin in requires_storage.keys():
if toload_cog in requires_storage[plugin]:
# noinspection PyUnresolvedReferences
extras.update({'storage': secrets_issuer.get_secret(plugin)})
extras.update({'storage': secrets_issuer.get_storage(plugin)})
break

try:
Expand Down

0 comments on commit e20acee

Please sign in to comment.