Giter VIP home page Giter VIP logo

Comments (13)

kic68 avatar kic68 commented on May 26, 2024 1

Hey @cedricalfonsi ,

thanks for the regex and sorry for the delay, vacation again :)

I have tested all email addresses in a little python script - and all are matching your regex. We only accept company addresses and they are (ASCII) [email protected]

Best,
Torben

from passbolt_api.

claytontstevenson avatar claytontstevenson commented on May 26, 2024

hey @kic68 thanks for the report! This is an issue we have identified and are already working on a fix. We have it tracked internally as PB-23949

It is related to a regex that was recently. Since you mentioned all of the usernames were normal email addresses my guess would be one of them is in caps and that is causing it as we have seen that as a cause of this

from passbolt_api.

kic68 avatar kic68 commented on May 26, 2024

Hey Clayton,
thanks for the very quick reply. I have just executed select username from users; on the DB server - and "unfortunately" in this case there's nothing in all caps. The most exotic characters are hyphen and dot. I cannot detect any special characters, also the lengths are not exceeding the "normal" ranges. Unfortunately I cannot disclose the data :(

I could also test it on this migrated instance once I am back from vacation in 10 days, if you let me know where this regex is located. These "compressed" JS files are just completely unreadable (and I am not a JS developer at all :) ).

Thanks anyways for looking into it.
Best,
Torben

from passbolt_api.

claytontstevenson avatar claytontstevenson commented on May 26, 2024

Hey Torben, I believe this fix was previously released as part of 3.12.1 and now we are on 4.1.1. Have you had a chance to update since you posted this? If so has this issue been resolved or is it still present for you?

from passbolt_api.

kic68 avatar kic68 commented on May 26, 2024

Hi, sorry, I was on vacation. The issue was still happening with 4.0.2-1-ce-non-root . So I'd rather keep this issue open.

from passbolt_api.

cedricalfonsi avatar cedricalfonsi commented on May 26, 2024

Hey @kic68,

This is quite unexpected.

Could you check if one of the emails doesn't validate with the following regex:

'/^[\p{L}0-9!#$%&\'*+\/=?^_`{|}~-]+(?:\.[\p{L}0-9!#$%&\'*+\/=?^_`{|}~-]+)*@(?:[_\p{L}0-9][-_\p{L}0-9]*\.)*(?:[\p{L}0-9][-\p{L}0-9]{0,62})\.(?:(?:[a-z]{2}\.)?[a-z]{2,})$/ui'

from passbolt_api.

cedricalfonsi avatar cedricalfonsi commented on May 26, 2024

Hey @kic68,

This is odd, here is the javascript which validates emails on the client side: https://github.com/passbolt/passbolt_styleguide/blob/67330b3353b4e812ce084b2164baa3cfa1e86e18/src/shared/lib/Validator/IsEmailValidator.js#L6

Regex should be similar, but it might be interpreted differently, I created a jsfiddle you could use to test your users usernames: https://jsfiddle.net/6w1t4sgf/22/

from passbolt_api.

kic68 avatar kic68 commented on May 26, 2024

Hey Cedric,

thanks a lot for the testing setup - I am definitely not familiar enough with JS to do this myself.

Unfortunately it seems all email addresses ("username") seem to be ok... the output is

    ☁️ "Running fiddle"
    "lalala"
    true
    true
    true
    true
   ... (many more in between)
    true
    true
    true

Best,
Torben

from passbolt_api.

cedricalfonsi avatar cedricalfonsi commented on May 26, 2024

There is one API configuration this error could be imputed too, but it's very unlikely that you changed it. Can you confirm there is no email regex override in the output of https://PASSBOLT_DOMAIN/settings.json.

You are looking for the following information:

            "email": {
                "validate": {
                    "regex": REGEX_VALUE
                }
            },

On another hand can you also confirm you are using the latest version of the browser extension? It should be 4.3.1 (or 4.3.0 on edge). You can find the API and browser extension versions by placing your mouse hover the heart in the bottom right corner of the application.

Can you provide us with your browser flavor and version also? It will help to reproduce if you are running an exotic one :)

from passbolt_api.

kic68 avatar kic68 commented on May 26, 2024

Good morning Cedric,

no, there is no email key in the output.

I need to set up a test environment to reproduce the issue again with the latest versions of passbolt (we haven't dared to upgrade anymore since then), but when I opened the issue this was happening in both Firefox and Chrome in their latest versions on a Mac. Also I was on the latest version of the plugin (I had to reinstall it a few times while switching between environments).

Best,
Torben

from passbolt_api.

kic68 avatar kic68 commented on May 26, 2024

Good evening Cedric,

I have dumped the production data, set up a new test environment with exactly that data - and it was working with newer versions.
You were totally right, there is an email key in settings.json - but it only appears in the newer (broken for me) versions.
The regex is set like this in production: "email":{"validate":{"regex":"\/.*@companyname\\.de\/"}} - and it is not set in the test environment where all versions work. I wanted to prevent colleagues from registering with their private addresses, but obviously I am doing it the wrong way.
I will try to fix and upgrade production beginning of next week!

Thanks a lot for your help and getting me into the right direction!

Have a nice weekend!
Best,
Torben

from passbolt_api.

kic68 avatar kic68 commented on May 26, 2024

Hi Cedric,

I can confirm that the issue goes away if you define the regex value correctly and completely:

  PASSBOLT_EMAIL_VALIDATE_REGEX:
    value: '/.*@(company\.de|company\.com|anothercompanyname\.de)/'

I have migrated our existing VM passbolt instance to k8s and, during that process, also added this regular expression. Unfortunately I did not know this would also affect already existing accounts with a domain we would rather not want to have and therefore was missing in the regex definition.

Adding all existing domain names now allows me to upgrade to 4.0. I am then running into the "Too many redirects" issue with 4.1, but this is something different and I will now debug this.

Thanks a lot for your help!
Torben

from passbolt_api.

claytontstevenson avatar claytontstevenson commented on May 26, 2024

Hey Torben,

For the "Too many redirects" issue you'll likely need to turn the option for force SSL off as this is frequently the cause of that issue when you have a proxy in front handling SSL. If that doesn't solve it for you feel free to head over to our forum and we can troubleshoot it there with you since that error is usually more environmental than code related.

from passbolt_api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.