-
Notifications
You must be signed in to change notification settings - Fork 63
Fix database settings #1231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Fix database settings #1231
Changes from 12 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
0193b49
Correct indentation
dan-fernandes a460794
Move role insertion out of scope of table creation
dan-fernandes 49957eb
Fix check for in-memory db
dan-fernandes 9d36d5a
Remove seemingly useless db commit
dan-fernandes 4dca8a9
Skip invalid metrics for StaticPool
dan-fernandes be9a434
Merge branch 'main' into fix-database-settings
dan-fernandes 22280af
Cache in-memory databases
dan-fernandes 2baf8a7
Pre-commit fixes
dan-fernandes ba2569e
Add test for in-memory authn
dan-fernandes 4c71dd6
Pre-commit fixes
dan-fernandes dd602ad
Remove unused global variables
dan-fernandes 9339ab4
Add option to not used cached databases
dan-fernandes 245b5f7
Revert "Add option to not used cached databases"
danielballan 3174de9
In tests with multiple databases, use file to avoid colliding in-memory.
danielballan dd71251
Use distinct named memory databases instead of on-disk.
danielballan 52dd6ce
Improve checking of in-memory SQLite database.
danielballan 1060690
Use random named memory name to avoid inter-module collisions
danielballan 0427eec
Recognize mode=memory query parameter
danielballan e6dc79c
Remove database settings
dan-fernandes dccd4a1
Fix is_memory_sqlite conditional on non-existent property
dan-fernandes 8091a83
Stop caching in-memory databases
dan-fernandes 6e55003
Auto-format
dan-fernandes 2d2e049
More formatting
dan-fernandes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # config.yml | ||
| trees: | ||
| - path: / | ||
| tree: tiled.examples.generated_minimal:tree | ||
| uvicorn: | ||
| host: 0.0.0.0 | ||
| port: 8000 | ||
| authentication: | ||
| providers: | ||
| - provider: test | ||
| authenticator: tiled.authenticators:DictionaryAuthenticator | ||
| args: | ||
| users_to_passwords: | ||
| alice: PASSWORD | ||
| secret_keys: | ||
| - SECRET |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| from pathlib import Path | ||
|
|
||
| import yaml | ||
|
|
||
| from tiled._tests.utils import enter_username_password | ||
| from tiled.client import Context, from_context | ||
| from tiled.server.app import build_app_from_config | ||
|
|
||
| here = Path(__file__).parent.absolute() | ||
|
|
||
|
|
||
| def test_good_path(): | ||
| """Test authn database defaults to in-memory catalog""" | ||
| with open(here / "test_configs" / "config_in_memory_authn.yml") as config_file: | ||
| config = yaml.load(config_file, Loader=yaml.BaseLoader) | ||
|
|
||
| app = build_app_from_config(config) | ||
| context = Context.from_app(app) | ||
|
|
||
| with enter_username_password("alice", "PASSWORD"): | ||
| client = from_context(context, remember_me=False) | ||
|
|
||
| client.logout() | ||
| context.close() | ||
|
|
||
| assert True |
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
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
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.