Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
ef4fb9e1
Commit
ef4fb9e1
authored
Mar 19, 2023
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*: fix wrong base64 usage
parent
67d21898
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
25 deletions
+24
-25
bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_common/StaticWebSite_getRedirectSourceUrlForOfficeJSApplication.py
...aticWebSite_getRedirectSourceUrlForOfficeJSApplication.py
+2
-2
bt5/erp5_payzen_secure_payment/DocumentTemplateItem/portal_components/document.erp5.PayzenService.py
...lateItem/portal_components/document.erp5.PayzenService.py
+2
-2
bt5/erp5_smart_assistant/SkinTemplateItem/portal_skins/erp5_smart_assistant/Query_createExpenseRecord.py
...l_skins/erp5_smart_assistant/Query_createExpenseRecord.py
+2
-2
erp5/util/testbrowser/examples/createERP5User.py
erp5/util/testbrowser/examples/createERP5User.py
+1
-1
product/ERP5/bin/bigfile_client_example.py
product/ERP5/bin/bigfile_client_example.py
+1
-1
product/ERP5Security/__init__.py
product/ERP5Security/__init__.py
+16
-17
No files found.
bt5/erp5_officejs/SkinTemplateItem/portal_skins/erp5_officejs_common/StaticWebSite_getRedirectSourceUrlForOfficeJSApplication.py
View file @
ef4fb9e1
...
...
@@ -19,8 +19,8 @@ except KeyError:
return
result_dict
try
:
encoded
=
name
.
replace
(
"definition_view/"
,
""
,
1
)
name
=
base64
.
decodebytes
(
encoded
)
encoded
=
name
.
replace
(
"definition_view/"
,
""
,
1
)
.
encode
()
name
=
base64
.
decodebytes
(
encoded
)
.
decode
()
base_64
=
True
except
binascii
.
Error
:
pass
...
...
bt5/erp5_payzen_secure_payment/DocumentTemplateItem/portal_components/document.erp5.PayzenService.py
View file @
ef4fb9e1
...
...
@@ -55,9 +55,9 @@ class PayzenREST:
def
callPayzenApi
(
self
,
URL
,
payzen_dict
):
base64string
=
base64
.
encodebytes
(
'%s:%s'
%
(
(
'%s:%s'
%
(
self
.
getServiceUsername
(),
self
.
getServiceApiKey
())).
replace
(
'
\
n
'
,
''
)
self
.
getServiceApiKey
())).
encode
()).
decode
().
replace
(
'
\
n
'
,
''
)
header
=
{
"Authorization"
:
"Basic %s"
%
base64string
}
LOG
(
'callPayzenApi'
,
WARNING
,
"data = %s URL = %s"
%
(
str
(
payzen_dict
),
URL
),
error
=
False
)
...
...
bt5/erp5_smart_assistant/SkinTemplateItem/portal_skins/erp5_smart_assistant/Query_createExpenseRecord.py
View file @
ef4fb9e1
...
...
@@ -2,8 +2,8 @@ import base64
portal
=
context
.
getPortalObject
()
expense_record_module
=
portal
.
getDefaultModule
(
'Expense Record'
)
sender
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
data
=
context
.
getData
(
)
data64
=
u''
.
join
(
base64
.
encodebytes
(
data
).
splitlines
())
data
=
bytes
(
context
.
getData
()
)
data64
=
u''
.
join
(
base64
.
encodebytes
(
data
).
decode
().
splitlines
())
photo_data
=
u'data:%s;base64,%s'
%
(
"image/*"
,
data64
)
expense_record_module
.
newContent
(
comment
=
comment
,
...
...
erp5/util/testbrowser/examples/createERP5User.py
View file @
ef4fb9e1
...
...
@@ -45,7 +45,7 @@ zope_url = url.rsplit('/', 2)[0]
import
base64
browser
.
mech_browser
.
addheaders
.
append
(
(
'Authorization'
,
'Basic %s'
%
base64
.
encodebytes
(
'%s:%s'
%
(
username
,
password
))
))
'Basic %s'
%
base64
.
encodebytes
(
(
'%s:%s'
%
(
username
,
password
)).
encode
())).
decode
(
))
for
index
in
range
(
user_nbr
):
new_username
=
"%s%d"
%
(
new_username_prefix
,
index
)
...
...
product/ERP5/bin/bigfile_client_example.py
View file @
ef4fb9e1
...
...
@@ -4,7 +4,7 @@ import six.moves.http_client
connection
=
six
.
moves
.
http_client
.
HTTPConnection
(
'192.168.242.68:12001'
)
import
base64
base64string
=
base64
.
encodebytes
(
'zope:insecure'
)[:
-
1
]
base64string
=
base64
.
encodebytes
(
b'zope:insecure'
).
decode
(
)[:
-
1
]
n
=
1
<<
20
...
...
product/ERP5Security/__init__.py
View file @
ef4fb9e1
...
...
@@ -62,24 +62,24 @@ if IS_ZOPE2: # BBB
def
_setUserNameForAccessLog
(
username
,
REQUEST
):
"""Make the current user look as `username` in Zope's Z2.log
Taken from Products.CMFCore.CookieCrumbler._setAuthHeader
"""
# Set the authorization header in the medusa http request
# so that the username can be logged to the Z2.log
# Put the full-arm latex glove on now...
Taken from Products.CMFCore.CookieCrumbler._setAuthHeader
"""
# Set the authorization header in the medusa http request
# so that the username can be logged to the Z2.log
# Put the full-arm latex glove on now...
try
:
# Is this WSGI ?
REQUEST
.
_orig_env
[
'wsgi.input'
]
except
KeyError
:
# Not WSGI, maybe Medusa
try
:
# Is this WSGI ?
REQUEST
.
_orig_env
[
'wsgi.input'
]
except
KeyError
:
# Not WSGI, maybe Medusa
try
:
medusa_headers
=
REQUEST
.
RESPONSE
.
stdout
.
_request
.
_header_cache
except
AttributeError
:
pass
else
:
medusa_headers
[
'authorization'
]
=
'Basic %s'
%
encodebytes
(
'%s:'
%
username
).
rstrip
()
medusa_headers
=
REQUEST
.
RESPONSE
.
stdout
.
_request
.
_header_cache
except
AttributeError
:
pass
else
:
REQUEST
.
_orig_env
[
'REMOTE_USER'
]
=
username
medusa_headers
[
'authorization'
]
=
'Basic %s'
%
encodebytes
((
'%s:'
%
username
).
encode
()).
decode
().
rstrip
()
else
:
REQUEST
.
_orig_env
[
'REMOTE_USER'
]
=
username
else
:
# zope4
def
_setUserNameForAccessLog
(
username
,
REQUEST
):
"""
...
...
@@ -87,7 +87,6 @@ else: # zope4
"""
pass
def
initialize
(
context
):
from
.
import
(
ERP5UserManager
,
...
...
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