Skip to content
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

Redesign plugin configuration to work with --plugin-secret #8

Closed
simonw opened this issue Jul 13, 2020 · 5 comments
Closed

Redesign plugin configuration to work with --plugin-secret #8

simonw opened this issue Jul 13, 2020 · 5 comments
Labels

Comments

@simonw
Copy link
Owner

simonw commented Jul 13, 2020

While working on #7 (live demo) I realized that the suggested mechanism for keeping password hashes private - the --plugin-secret mechanism - doesn't actually work - because that mechanism only works for secrets at the root of the plugin configuration, not secrets that are nested further down.

This is a huge problem. Even hashed passwords should not be exposed as visible in metadata.json.

So I need a better solution to hiding them - a solution which is probably going to involve changes to Datasette core.

@simonw simonw added the design label Jul 13, 2020
@simonw
Copy link
Owner Author

simonw commented Jul 13, 2020

One possibility: make /-/metadata itself subject to a permission check, then document how to forbid access to it.

@simonw
Copy link
Owner Author

simonw commented Jul 13, 2020

Potential short-term fix: redesign the datasette-auth-passwords plugin configuration to allow for passwords to be set at the root level of the config, e.g. as "user1_password_hash": "..."

@simonw
Copy link
Owner Author

simonw commented Jul 13, 2020

OK, that's how I'm going to do this. New configuration format design:

{
    "plugins": {
        "datasette-auth-passwords": {
            "actors": {
                "user1": {
                    "id": "user1",
                    "name": "Your name"
                }
            },
            "user1_password_hash": {
                "$env": "HASH_1"
            }
        }
    }
}

@simonw
Copy link
Owner Author

simonw commented Jul 13, 2020

This is really just a stop-gap measure unti SQL configuration is available in #6.

@simonw
Copy link
Owner Author

simonw commented Jul 13, 2020

The "actors" bit will be optional - without it each actor will default to just {"id": "your_username"}

@simonw simonw changed the title Solve the secret password hash problem (public in metadata) Redesign plugin configuration to work with --plugin-secret Jul 13, 2020
simonw added a commit that referenced this issue Jul 13, 2020
@simonw simonw closed this as completed Jul 13, 2020
simonw added a commit that referenced this issue Jul 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant