Giter Site home page Giter Site logo

Check usernames against userids about lastuser HOT 9 CLOSED

jace avatar jace commented on July 29, 2024
Check usernames against userids

from lastuser.

Comments (9)

kracekumar avatar kracekumar commented on July 29, 2024

Lastuser expects username to be in lower characters(https://github.com/hasgeek/lastuser/blob/master/lastuser_oauth/forms/profile.py#L67).

newid from coaster which generates userid will contain at least one uppercase character.

In [46]: r = []

In [47]: for i in range(100000):
    new_id = newid()
    for c in new_id:
        if c.isupper():
            r.append(True)
            break
   ....:

In [48]: len(r)
Out[48]: 100000

is it safe to assume User B's username will not collide with User A's userid because one character in userid will be uppercase ?

from lastuser.

jace avatar jace commented on July 29, 2024

Not a safe assumption. It's base64 and that could be lowercase or uppercase.

from lastuser.

miteshashar avatar miteshashar commented on July 29, 2024

@jace You already handled this here? https://github.com/hasgeek/lastuser/pull/67/files#L5R59

from lastuser.

jace avatar jace commented on July 29, 2024

Yes, this is now resolved.

from lastuser.

miteshashar avatar miteshashar commented on July 29, 2024

We should use the commit messages to close these. Makes life easy, I guess.

@kracekumar Apart from changing status of issue, tagging commits with issues always helps sequentially understand how the issue was sorted. That is basically what I'd been trying to convey.

from lastuser.

miteshashar avatar miteshashar commented on July 29, 2024

@jace Won't we need tests for these?

from lastuser.

jace avatar jace commented on July 29, 2024

Slightly tricky to write a test at the moment because we require usernames to be lowercase right now and userids are almost always mixed case. The lowercase requirement comes from within is_valid_username (IIRC, since coaster.valid_username requires lowercase).

If we relax the lowercase requirement in future, opting for case-insensitive usernames, this will need a test.

from lastuser.

kracekumar avatar kracekumar commented on July 29, 2024

@miteshashar I have been doing that check hasgeek/hacknight#236. There are reasons I do it manually.

  1. If pull request din't fix the issue, I need to reopen the status of the issue.

Once code is merged then I place a commit with pull request id or commit sha.

from lastuser.

miteshashar avatar miteshashar commented on July 29, 2024

Github has changed this. Github does not close the issue, unless the pull request is merged into master.

from lastuser.

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.