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

Add possibility to configure sessions over dsn #348

Open
alexander-schranz opened this issue Aug 31, 2020 · 1 comment
Open

Add possibility to configure sessions over dsn #348

alexander-schranz opened this issue Aug 31, 2020 · 1 comment

Comments

@alexander-schranz
Copy link
Contributor

I would think it would be great to configure sessions over DSN.

Currently a config for doctrine_dbal looks like the following in sulu:

    sessions:
        default:
            backend:
                type: doctrinedbal
            workspace: "%env(PHPCR_WORKSPACE)%"
        live:
            backend:
                type: doctrinedbal
            workspace: "%env(PHPCR_WORKSPACE)%_live"

And config for jackrabbit look like this in sulu:

parameters:
    env(JACKRABBIT_URL): 'http://localhost:8080/server/'
    env(PHPCR_USER): 'admin'
    env(PHPCR_PASSWORD): 'admin'

# ...
    sessions:
        default:
            backend:
                type: jackrabbit
                url: "%env(JACKRABBIT_URL)%"
            workspace: "%env(PHPCR_WORKSPACE)%"
            username: "%env(PHPCR_USER)%"
            password: "%env(PHPCR_PASSWORD)%"
        live:
            backend:
                type: jackrabbit
                url: "%env(JACKRABBIT_URL)%"
            workspace: "%env(PHPCR_WORKSPACE)%_live"
            username: "%env(PHPCR_USER)%"
            password: "%env(PHPCR_PASSWORD)%"

So the dsn can be very different I think, currently I would go with something like:

PHPCR_DSN=doctrindbal://default
PHPCR_DSN=jackrabbit://admin:admin@localhost:8080/server/?workspace=default

Which can be configured this way:

    sessions:
        default:
            dsn: "%env(PHPCR_DSN)%"

I'm not sure about the jackrabbit format and if jackrabbit can be behind https?

@dbu
Copy link
Member

dbu commented Sep 1, 2020

i like the idea. if you have time to work on it, please do.

for the doctrinedbal dsn, we should use the dbal connection name as "domain" i think. it could look like doctrinedbal://default/default then. for jackrabbit, we could say that that the "path" is the http path, while the "file" is the workspace, to be more consistent with doctrinedbal. or we could make doctrinedbal use ?workspace=default as well, this might be easier to read, particularly for the default & default case. i guess workspace should be optional and default to "default"?

we talk to jackrabbit with the http protocol, so it technically could be https. i think we should allow for that possibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants