Closed Bug 863749 Opened 11 years ago Closed 11 years ago

Create API for checking if a display name or subdomain is free

Categories

(Webmaker Graveyard :: Login, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: sedge, Assigned: alicoding)

Details

Attachments

(3 obsolete files)

To enhance the UX, there should be a Login API call that checks if a passed displayName or subdomain is free to be registered.
This likely wants to be done for internal use by our node apps, but not exposed externally.  Following the same pattern cade has done with MakeAPI (e.g., using basic authentication on the route) should be enough.

I suggest:

GET http://login.webmaker.org/user/subdomain/:name

returns 1 of 3 things:

404 (Not Found) - subdomain given in `:name` is available (i.e., wasn't found/taken)
406 (Not Acceptable) - subdomain given in `:name` is blacklisted (i.e., we won't accept it)
200 (OK) - subdomain given in `:name` is good and being used (i.e., someone has already taken it)
I'm probably going to get one of my new guys to try this as a first bug, I'll assign later today.
Assignee: nobody → ali.aldallal
Status: NEW → ASSIGNED
Attachment #749287 - Flags: review?(kieran.sedgwick)
Comment on attachment 749287 [details] [review]
https://github.com/mozilla/login.webmaker.org/pull/54

A few changes required, and a question that needs to be resolved but other than that it looks good!  Check the PR for notes, and flag for review again when you're done.
Attachment #749287 - Flags: review?(kieran.sedgwick) → review-
Attachment #749287 - Flags: review-
Attachment #749307 - Flags: review?(kieran.sedgwick)
Attachment #749307 - Flags: review?(david.humphrey)
Attachment #749287 - Attachment is obsolete: true
Attachment #749307 - Attachment is obsolete: true
Attachment #749307 - Flags: review?(kieran.sedgwick)
Attachment #749307 - Flags: review?(david.humphrey)
Attachment #749308 - Flags: review?(david.humphrey)
Comment on attachment 749308 [details] [review]
https://github.com/mozilla/login.webmaker.org/pull/54

Change the order of the check cases and reformat the code.
Attachment #749308 - Attachment is obsolete: true
Attachment #749308 - Flags: review?(david.humphrey)
One comment in PR, fix that and this is r+ from me.  Let sedge look at it again.
Comment on attachment 749308 [details] [review]
https://github.com/mozilla/login.webmaker.org/pull/54

Removed the unnecessary code from the error case and removed some blank line
Attachment #749308 - Flags: review?(david.humphrey)
Attachment #749308 - Flags: review?(kieran.sedgwick)
Comment on attachment 749308 [details] [review]
https://github.com/mozilla/login.webmaker.org/pull/54

Changed the variable name of the return value to 'name'
Comment on attachment 749308 [details] [review]
https://github.com/mozilla/login.webmaker.org/pull/54

Hey Ali, looking good.  Remember though, the fewer commits the better (and ideally just one per bug) so r+ if you rebase.
Attachment #749308 - Flags: review?(kieran.sedgwick) → review-
Commit pushed to master at https://github.com/mozilla/login.webmaker.org

https://github.com/mozilla/login.webmaker.org/commit/cc0cbe7f4629d42eeeda23e10eafe82134f4de9e
Fixes Bug 863749 - Create API for checking if a subdomain is free r=humph,sedge
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Attachment #749308 - Flags: review?(david.humphrey)
Attachment mime type: text/plain text/plain text/plain → text/x-github-pull-request text/x-github-pull-request text/x-github-pull-request
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: