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

MongoTokenStore index should be able to skip ensureIndexes() #51

Closed
erikrz opened this issue Jan 20, 2021 · 3 comments · Fixed by #53
Closed

MongoTokenStore index should be able to skip ensureIndexes() #51

erikrz opened this issue Jan 20, 2021 · 3 comments · Fixed by #53

Comments

@erikrz
Copy link
Contributor

erikrz commented Jan 20, 2021

Enhancement Description

In controlled environments, the application mongodb user has no permissions to create collections or indexes, and in those cases, collection and indexes should be created before hand. I have a requirement to deploy in one of those environments, but the MongoTokenStore is always trying to create an index, thus making the application fail at startup due to permissions denied.

Current Behaviour

When creating a MongoTokenStore via the Builder, it always runs the ensureIndexes() method, which tries to create an index for the tracking token collection. In my use case, this causes an error and the application fails on startup.

Wanted Behaviour

I want to be able to configure in the builder, whether if I want the indexes being created by the application on runtime (as the default behavior it now has) or skip the index creation, as it was created before running the application.

Possible Workarounds

In the MongoTokenStore builder, add a method

public Builder ensureIndexes(boolean ensureIndexes){
...
}

Where we can configure this behavior.

@erikrz erikrz changed the title MongoTokenStore index should be able to skip ensureIndexes MongoTokenStore index should be able to skip ensureIndexes() Jan 20, 2021
@smcvb
Copy link
Member

smcvb commented Jan 22, 2021

Perfectly fine recommendation here @erikrz!
Shouldn't be overly complex to introduce either through the flexibility of the builder.

Now, a question towards you: would you like to provide a pull request introducing this enhancement?

@erikrz
Copy link
Contributor Author

erikrz commented Jan 22, 2021

Yeah, absolutely!
I'll be glad to contribute. I'm having trouble signing the Contributor License Agreement, though. Visiting the URL in the contribution guidelines redirects me to an unreachable place.

@smcvb
Copy link
Member

smcvb commented Jan 25, 2021

CLAhub (the app for signing that is) has gone down some time ago, but we've only recently noticed this ourselves.
As an effect, you're not able to sign a CLA.

Note that it is not a hard requirement from our end that you sign one.
It purely serves the purpose to give the contributor more rights.
Whether you are okay with providing a PR regardless of the CLA in place is something I cannot decide for you of course.

If not, please let us know. Then we'll nudge you here as soon as we've set up a replacement.
If you are fine without signing it, then I imagine I'll see a PR somewhere in the future.

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

Successfully merging a pull request may close this issue.

2 participants