Store swift token in the Moodle Universal Cache#734
Merged
Conversation
Presently tool_objectfs authenticates to openstack, then caches the resulting authtoken in the database (mdl_config_plugins / tool_objectfs / openstack_authtoken) until it expires. This is undesirable from two angles: 1. When particulars change (eg destination project/tenant) in config.php the plugin continues using the existing token/details, acting on the wrong location (eg uploading files to the wrong location) 2. This cached token is available in database dumps, and when restored to non-prod environments, continuing to persist even if all MUC caches are purged on all web/cron servers. This change moves the token to the Moodle Universal Cache, with a localstoreallowed definition, this means a purge of caches will remove the token. I chose local store allowed as there's no reason to not allow each cluster server to acquire it's own token to openstack as you can have more than one token and the load from requesting tokens per node in the cluster is unlikely to be onerous
12c0785 to
2299d86
Compare
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.
Presently tool_objectfs authenticates to openstack, then caches the resulting authtoken in the database (mdl_config_plugins / tool_objectfs / openstack_authtoken) until it expires.
This is undesirable from two angles:
When particulars change (eg destination project/tenant) in config.php the plugin continues using the existing token/details, acting on the wrong location (eg uploading files to the wrong location)
This cached token is available in database dumps, and when restored to non-prod environments, continuing to persist even if all MUC caches are purged on all web/cron servers.
This change moves the token to the Moodle Universal Cache, with a localstoreallowed definition, this means a purge of caches will remove the token.
I chose local store allowed as there's no reason to not allow each cluster server to acquire it's own token to openstack as you can have more than one token and the load from requesting tokens per node in the cluster is unlikely to be onerous (and you can store it in your fastest available cache)