Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
persona
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hexang 息壤平台
persona
Commits
dc025fbe
Commit
dc025fbe
authored
13 years ago
by
Shane Tomlinson
Browse files
Options
Downloads
Patches
Plain Diff
Adding test that shows how sync_key can be used to add any email address to any account.
parent
2362aac7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
browserid/static/dialog/test/qunit/browserid-identities_test.js
+41
-0
41 additions, 0 deletions
...rid/static/dialog/test/qunit/browserid-identities_test.js
with
41 additions
and
0 deletions
browserid/static/dialog/test/qunit/browserid-identities_test.js
+
41
−
0
View file @
dc025fbe
...
...
@@ -196,4 +196,45 @@ steal.plugins("jquery", "funcunit/qunit").then("/dialog/resources/browserid-iden
stop
();
});
test
(
"
syncIdentity without first validating email
"
,
function
()
{
BrowserIDNetwork
.
authenticate
(
"
testuser@testuser.com
"
,
"
testuser
"
,
function
()
{
// First, force removal that way we know it is not part of our list.
BrowserIDIdentities
.
removeIdentity
(
"
unvalidated@unvalidated.com
"
,
function
()
{
clearEmails
();
BrowserIDIdentities
.
syncIdentities
(
function
onSuccess
()
{
var
identities
=
BrowserIDIdentities
.
getStoredIdentities
();
// Make sure the server has forgotten about this email address.
equal
(
"
unvalidated@unvalidated.com
"
in
identities
,
false
,
"
The removed email should not be on the list.
"
);
// This next call will call /wsapi/set_key on a
// key that has not been validated.
BrowserIDIdentities
.
syncIdentity
(
"
unvalidated@unvalidated.com
"
,
"
issuer
"
,
function
(
keypair
)
{
// Clear all the local emails, then refetch the list from the server
// just to be sure we are seeing what the server sees.
clearEmails
();
BrowserIDIdentities
.
syncIdentities
(
function
onSuccess
()
{
var
identities
=
BrowserIDIdentities
.
getStoredIdentities
();
// woah. Things just went wrong.
equal
(
"
unvalidated@unvalidated.com
"
in
identities
,
false
,
"
The unvalidated email should not be added just through calling sync_key
"
);
start
();
},
failure
(
"
syncIdentities failure
"
));
},
failure
(
"
syncIdentity failure
"
));
},
failure
(
"
syncIdentities failure
"
));
},
failure
(
"
removeEmail failure
"
));
},
failure
(
"
Authentication failure
"
));
stop
();
});
});
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment