Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thomas Leymonerie
slapos.core
Commits
765ae78f
Commit
765ae78f
authored
Feb 28, 2017
by
Rafael Monnerat
Committed by
Alain Takoudjou
Mar 01, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_web: BrowserID is dead, so drop unused code.
parent
1d4e3aed
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
244 deletions
+33
-244
master/bt5/slapos_web/ExtensionTemplateItem/portal_components/extension.erp5.ViFiBWeb.py
...TemplateItem/portal_components/extension.erp5.ViFiBWeb.py
+1
-49
master/bt5/slapos_web/ExtensionTemplateItem/portal_components/extension.erp5.ViFiBWeb.xml
...emplateItem/portal_components/extension.erp5.ViFiBWeb.xml
+32
-6
master/bt5/slapos_web/SkinTemplateItem/portal_skins/vifib_hosting/BrowserID_checkUserExistence.xml
...rtal_skins/vifib_hosting/BrowserID_checkUserExistence.xml
+0
-28
master/bt5/slapos_web/SkinTemplateItem/portal_skins/vifib_hosting/BrowserID_setServerToken.xml
...m/portal_skins/vifib_hosting/BrowserID_setServerToken.xml
+0
-28
master/bt5/slapos_web/SkinTemplateItem/portal_skins/vifib_hosting/BrowserID_validateAssertion.xml
...ortal_skins/vifib_hosting/BrowserID_validateAssertion.xml
+0
-28
master/bt5/slapos_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewBrowserIdLogin.xml
...tal_skins/vifib_hosting/WebSection_viewBrowserIdLogin.xml
+0
-58
master/bt5/slapos_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewBrowserIdLogin.zpt
...tal_skins/vifib_hosting/WebSection_viewBrowserIdLogin.zpt
+0
-47
No files found.
master/bt5/slapos_web/ExtensionTemplateItem/portal_components/extension.erp5.ViFiBWeb.py
View file @
765ae78f
...
...
@@ -35,8 +35,7 @@ import apiclient.discovery
import
httplib2
import
oauth2client.client
import
socket
from
Products.ERP5Security.ERP5UserManager
import
getUserByLogin
from
Products.ERP5Type.UnrestrictedMethod
import
UnrestrictedMethod
# common methods
def
_getCacheFactory
(
self
,
cache_factory_name
):
...
...
@@ -180,50 +179,3 @@ def Google_checkUserExistence(self):
# user exist if server gave some correct response without waiting for user
return
response
.
status
in
(
200
,
204
)
# Browser ID
def
BrowserID_setServerToken
(
self
,
key
,
body
):
setServerToken
(
self
,
key
,
body
,
'browser_id_auth_token_cache_factory'
)
def
BrowserID_getServerToken
(
self
,
key
):
return
getServerToken
(
self
,
key
,
'browser_id_auth_token_cache_factory'
)
def
BrowserID_validateAssertion
(
self
,
assertion
):
connection
=
httplib
.
HTTPSConnection
(
host
=
'browserid.org'
,
timeout
=
5
)
data
=
urllib
.
urlencode
({
'assertion'
:
assertion
,
'audience'
:
self
.
REQUEST
.
get
(
'SERVER_URL'
)})
headers
=
{
'Content-type'
:
'application/x-www-form-urlencoded'
}
connection
.
request
(
'POST'
,
'/verify'
,
data
,
headers
)
response
=
connection
.
getresponse
()
if
response
.
status
!=
200
:
return
None
try
:
body
=
json
.
loads
(
response
.
read
())
except
Exception
:
return
None
return
body
@
UnrestrictedMethod
def
BrowserID_checkUserExistence
(
self
):
hash
=
self
.
REQUEST
.
get
(
'__ac_browser_id_hash'
)
try
:
user_dict
=
BrowserID_getServerToken
(
self
,
hash
)
except
KeyError
:
return
False
user
=
user_dict
[
'login'
]
tag
=
'%s_user_creation_in_progress'
%
user
person_list
=
getUserByLogin
(
self
.
getPortalObject
(),
user
)
if
len
(
person_list
)
==
0
:
if
self
.
getPortalObject
().
portal_activities
.
countMessageWithTag
(
tag
)
==
0
:
user_entry
=
{
'reference'
:
user
,
'email'
:
user
[
4
:],
'first_name'
:
None
,
'last_name'
:
None
}
self
.
Base_createOauth2User
(
tag
,
**
user_entry
)
return
False
else
:
return
True
master/bt5/slapos_web/ExtensionTemplateItem/portal_components/extension.erp5.ViFiBWeb.xml
View file @
765ae78f
...
...
@@ -6,10 +6,22 @@
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
ViFiBWeb
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
extension.erp5.ViFiBWeb
</string>
</value>
...
...
@@ -34,9 +46,8 @@
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple>
<string>
W:143, 2: Redefining built-in \'hash\' (redefined-builtin)
</string>
<string>
W:164, 2: Redefining built-in \'hash\' (redefined-builtin)
</string>
<string>
W:212, 2: Redefining built-in \'hash\' (redefined-builtin)
</string>
<string>
W:142, 2: Redefining built-in \'hash\' (redefined-builtin)
</string>
<string>
W:163, 2: Redefining built-in \'hash\' (redefined-builtin)
</string>
</tuple>
</value>
</item>
...
...
@@ -47,13 +58,28 @@
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
...
...
@@ -66,7 +92,7 @@
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
</value>
</item>
</dictionary>
...
...
@@ -75,7 +101,7 @@
</dictionary>
</pickle>
</record>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
...
...
master/bt5/slapos_web/SkinTemplateItem/portal_skins/vifib_hosting/BrowserID_checkUserExistence.xml
deleted
100644 → 0
View file @
1d4e3aed
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ExternalMethod"
module=
"Products.ExternalMethod.ExternalMethod"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_function
</string>
</key>
<value>
<string>
BrowserID_checkUserExistence
</string>
</value>
</item>
<item>
<key>
<string>
_module
</string>
</key>
<value>
<string>
ViFiBWeb
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
BrowserID_checkUserExistence
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_web/SkinTemplateItem/portal_skins/vifib_hosting/BrowserID_setServerToken.xml
deleted
100644 → 0
View file @
1d4e3aed
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ExternalMethod"
module=
"Products.ExternalMethod.ExternalMethod"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_function
</string>
</key>
<value>
<string>
BrowserID_setServerToken
</string>
</value>
</item>
<item>
<key>
<string>
_module
</string>
</key>
<value>
<string>
ViFiBWeb
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
BrowserID_setServerToken
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_web/SkinTemplateItem/portal_skins/vifib_hosting/BrowserID_validateAssertion.xml
deleted
100644 → 0
View file @
1d4e3aed
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ExternalMethod"
module=
"Products.ExternalMethod.ExternalMethod"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_function
</string>
</key>
<value>
<string>
BrowserID_validateAssertion
</string>
</value>
</item>
<item>
<key>
<string>
_module
</string>
</key>
<value>
<string>
ViFiBWeb
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
BrowserID_validateAssertion
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewBrowserIdLogin.xml
deleted
100644 → 0
View file @
1d4e3aed
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ZopePageTemplate"
module=
"Products.PageTemplates.ZopePageTemplate"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/html
</string>
</value>
</item>
<item>
<key>
<string>
expand
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
WebSection_viewBrowserIdLogin
</string>
</value>
</item>
<item>
<key>
<string>
output_encoding
</string>
</key>
<value>
<string>
utf-8
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<unicode></unicode>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewBrowserIdLogin.zpt
deleted
100644 → 0
View file @
1d4e3aed
<html>
<tal:block
tal:define=
"website_url python: here.getWebSiteValue().absolute_url();
dummy python: request.RESPONSE.setCookie('redirect_after_login', context.REQUEST.form.get('callback_url', website_url), path='/');"
>
</tal:block>
<script
src=
"https://code.jquery.com/jquery-1.9.1.js"
></script>
<script
src=
"https://browserid.org/include.js"
type=
"text/javascript"
></script>
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
navigator
.
id
.
get
(
gotAssertion
);
return
false
;});
function
post_to_url
(
path
,
params
,
method
)
{
method
=
method
||
"
post
"
;
// Set method to post by default, if not specified.
// The rest of this code assumes you are not using a library.
// It can be made less wordy if you use one.
var
form
=
document
.
createElement
(
"
form
"
);
form
.
setAttribute
(
"
method
"
,
method
);
form
.
setAttribute
(
"
action
"
,
path
);
for
(
var
key
in
params
)
{
if
(
params
.
hasOwnProperty
(
key
))
{
var
hiddenField
=
document
.
createElement
(
"
input
"
);
hiddenField
.
setAttribute
(
"
type
"
,
"
hidden
"
);
hiddenField
.
setAttribute
(
"
name
"
,
key
);
hiddenField
.
setAttribute
(
"
value
"
,
params
[
key
]);
form
.
appendChild
(
hiddenField
);
}
}
document
.
body
.
appendChild
(
form
);
form
.
submit
();
}
function
gotAssertion
(
assertion
)
{
// got an assertion, now send it up to the server for verification
if
(
assertion
!==
null
)
{
post_to_url
(
"
https://www.slapos.org/login_with_browser_id/
"
,
{
'
assertion
'
:
assertion
})
}
}
</script>
<body>
Waiting login ....
</body>
</html>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment