#Savaged.us Importer API Key
1 messages · Page 1 of 1 (latest)
Weird. I'm running Foundry as an Electron app hosted on a Digitalocean instance. I put the key into the settings yesterday and it worked while I was logged in. I logged in today to grab updates to the player characters and it was gone again.
I've had it get wiped out from time to time, a while ago though. Never quite pinned down what the issue was,
hasn't happened (that I've noticed) for a bit
@hard marsh Are you running v9?
this was a while back. Maybe even under v7, or early in v8
Hmm...
Under v7 I think it was using generic local storage rather than the module settings.
Yeah, it's set as a client setting.
game.settings.register(MODULE_NAME, "apiKey", {
name: "Savaged.us API key:",
hint: "To import characters and bestiary entries directly, please enter your Savaged.us API key.",
type: String,
default: '',
scope: "client",
config: true,
onChange: async (value) => {
if (!value || (value && await testConnection(value))) {
ui.actors.render(true)
}
}
})
I have no idea what would cause it to clear. Are you using ublock by any chance?
Found what you're referring to. I'm not using uBlock, but I was using Firefox (no extensions except for Bitwarden - password manager).
Is it possible that it wouldn't keep the setting if I logged in with Firefox yesterday and then again with Vivaldi today? Does Foundry separate clients that way?
Because I was in Firefox yesterday. Today, when I saw it missing, I was using my usual browser (Vivaldi - Chromium based) since it was open.
Only thing on that is that, when I saw the problem yesterday, it occurred without switching browsers.
Just opened in Firefox now (since I added the API key back using Vivaldi) and the key was still there.
Yes! Each client is different.
It's stored on the specific browser and browsers don't share local storage
Wait, it was in Firefox after adding it in Vivaldi even though it wasn't previously in FF?
And you're not using different browser profiles?
No. I added it in Vivaldi this morning after originally adding it in Firefox yesterday. So, the fact it uses local storage for settings might be why I saw this.
Ah, OK
I figured Foundry stored settings and similar data in a persistent location (i.e. The data directory). That's scary that if I clear out my browser's local storage I'll lose all my Foundry settings. That seems like a poor architecture choice. Am I misunderstanding something about Foundry settings?
Not all, just client settings. There are world and client setting options.
I can see if I can store it at the world level without it being a field for everyone to see. I'm still sort of new to setting configurations honestly.
OK, so this is possible; however, I think the reason the original developer did this as a client/localstorage setting is because it is an API key and anyone with a GM role (whether accessed legitimately or not) can access the API key from any other client.
So it's a trade off: risk someone's API key getting stolen or inconveniently have to add it to your specific client once in a while.
I'd rather be a bit more cautious personally.