Skip to content

Fix missing password policy definitions #7225

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

Conversation

mtrezza
Copy link
Member

@mtrezza mtrezza commented Feb 24, 2021

New Pull Request Checklist

Issue Description

In #7040 some new parameter definitions in passwordPolicy were improperly added without specifying default parameters.

Related issue: (none; addition to #7017, #7040)

Approach

  • Adds default value for Parse Server config definition passwordPolicy.resetTokenReuseIfValid
  • Improves contribution guide to properly add nested parameter groups to Parse Server config

TODOs before merging

  • Add entry to changelog
  • Add changes to documentation (guides, repository pages, in-code descriptions)

@ghost
Copy link

ghost commented Feb 24, 2021

Warnings
⚠️ Please add a changelog entry for your changes.

Generated by 🚫 dangerJS

@codecov
Copy link

codecov bot commented Feb 24, 2021

Codecov Report

Merging #7225 (6fee7ad) into master (c8e822b) will increase coverage by 0.01%.
The diff coverage is n/a.

❗ Current head 6fee7ad differs from pull request most recent head afa8b3e. Consider uploading reports for the commit afa8b3e to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7225      +/-   ##
==========================================
+ Coverage   93.92%   93.93%   +0.01%     
==========================================
  Files         181      181              
  Lines       13267    13267              
==========================================
+ Hits        12461    12463       +2     
+ Misses        806      804       -2     
Impacted Files Coverage Δ
src/RestWrite.js 93.92% <0.00%> (-0.16%) ⬇️
src/Adapters/Files/GridFSBucketAdapter.js 80.32% <0.00%> (+0.81%) ⬆️
src/ParseServerRESTController.js 98.50% <0.00%> (+1.49%) ⬆️
src/batch.js 93.10% <0.00%> (+1.72%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c8e822b...afa8b3e. Read the comment docs.

2. If a parameter group (nested parameter) has been added:
- add the environment variable prefix for the parameter group to `nestedOptionEnvPrefix` in [/resources/buildConfigDefinition.js](https://github.com/parse-community/parse-server/blob/master/resources/buildConfigDefinition.js)
- add the parameter group type to `nestedOptionTypes` in [/resources/buildConfigDefinition.js](https://github.com/parse-community/parse-server/blob/master/resources/buildConfigDefinition.js)
3. Execute `npm run definitions` to automatically create the definitions in [/src/Options/Definitions.js][config-def] and [/src/Options/docs.js][config-docs].
Copy link
Member

@dplewis dplewis Feb 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parameter group / group type / nested parameters sounds confusing. I think we should make the user aware of the /resources/buildConfigDefinition.js file. Like if you need to add definition types add them to buildConfigDefinition.js

I want to add a new type NumberOrObject, which file should I use?

Copy link
Member Author

@mtrezza mtrezza Feb 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parameter group / group type / nested parameters sounds confusing.

Yes, I struggled myself to find a proper term. A new config parameter only needs to be added to buildConfigDefinition.js if it is a new interface type, otherwise the file doesn't have to be touched. By new interface I mean a parameter that is actually an object that holds sub-parameters, like PagesOptions. What term do you suggest?

I want to add a new type NumberOrObject, which file should I use?

Good question, I think no change required in buildConfigDefinition.js, because it can also be a number, therefore not sure how this would be handled. This may not be a guide that covers all cases, but the reason I added this paragraph some months ago was that contributors often did incorrectly implement new parameters, most often leaving out the buildConfigDefinition.js file. I don't think a simple "if you need to add definition types add them to buildConfigDefinition.js" will cut it.

Copy link
Member

@dplewis dplewis Feb 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, when I first documented the definitions, I assumed the buildConfigDefinition.js would rarely get updated (4 people have touched it in 4 years, I being the second).

@davimacedo Since you haven't touched the buildConfigDefinition.js do you have any suggestions?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can automate the 2 things that sometimes need to get updated.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any update on this?

Copy link
Member Author

@mtrezza mtrezza Jul 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dplewis I reworded this with an example of an existing parameter. That should make it easier to follow. If you have any wording suggestions, please let know, otherwise we just go ahead and leave this up for improvement in the future. It's an improvement over status quo anyway.

@dplewis
Copy link
Member

dplewis commented Apr 15, 2021

@mtrezza Can you resolve the conflicts? Anything else you want to add to the PR?

@mtrezza
Copy link
Member Author

mtrezza commented Apr 15, 2021

This looks old, I'll work this over in the next few days, not sure whether all the info is still valid.

@mtrezza mtrezza marked this pull request as draft April 15, 2021 16:52
@mtrezza mtrezza force-pushed the fix-missing-password-policy-definitions branch from d5dcf89 to 7fc548f Compare May 2, 2021 19:07
@mtrezza mtrezza requested a review from davimacedo May 2, 2021 19:09
@mtrezza mtrezza marked this pull request as ready for review May 2, 2021 19:10
@mtrezza
Copy link
Member Author

mtrezza commented May 2, 2021

@dplewis This is ready for review.

@mtrezza mtrezza requested review from davimacedo, Moumouls and dplewis and removed request for davimacedo and Moumouls July 26, 2021 20:09
Copy link
Member

@davimacedo davimacedo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mtrezza mtrezza merged commit cc3cd23 into parse-community:master Jul 26, 2021
@mtrezza mtrezza deleted the fix-missing-password-policy-definitions branch July 26, 2021 22:23
@mtrezza mtrezza removed the request for review from dplewis July 26, 2021 22:23
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.0.0-beta.1

@parseplatformorg parseplatformorg added the state:released-beta Released as beta version label Nov 1, 2021
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.0.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released Released as stable version state:released-beta Released as beta version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants