Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #14 from lalithkota/17.0-develop
Browse files Browse the repository at this point in the history
Fixed crypto admin group access and fixed update prov bug 17.0
  • Loading branch information
shibu-narayanan authored Apr 23, 2024
2 parents 40df856 + 14ddb6f commit 7d65284
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 15 deletions.
7 changes: 4 additions & 3 deletions g2p_encryption/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

/*
:Author: David Goodger ([email protected])
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.

See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -274,7 +275,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -300,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down
7 changes: 4 additions & 3 deletions g2p_encryption_keymanager/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

/*
:Author: David Goodger ([email protected])
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.

See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -274,7 +275,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -300,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down
7 changes: 4 additions & 3 deletions g2p_encryption_rest_api/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

/*
:Author: David Goodger ([email protected])
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.

See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -274,7 +275,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -300,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down
6 changes: 4 additions & 2 deletions g2p_registry_encryption/models/partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ def create(self, vals_list):
if not is_encrypt_fields:
return super().create(vals_list)

vals_list = [vals_list] if isinstance(vals_list, dict) else vals_list

prov = self.env["g2p.encryption.provider"].get_registry_provider()
for vals in vals_list:
if vals.get("is_registrant", False):
Expand Down Expand Up @@ -62,15 +64,15 @@ def write(self, vals):
vals = rec_values_list
else:
vals = json.loads(prov.decrypt_data(encrypted_val).decode()).update(vals)
to_be_encrypted = self.gather_fields_to_be_enc_from_dict(vals)
to_be_encrypted = self.gather_fields_to_be_enc_from_dict(vals, prov)

vals["encrypted_val"] = prov.encrypt_data(json.dumps(to_be_encrypted).encode())

return super().write(vals)

def _fetch_query(self, query, fields):
fields = set(fields)
res = super()._fetch_query(query, fields)
fields = {field.name for field in fields}
prov = self.env["g2p.encryption.provider"].get_registry_provider()
enc_fields_set = prov.get_registry_fields_set_to_enc().intersection(fields)
if not enc_fields_set:
Expand Down
7 changes: 4 additions & 3 deletions g2p_registry_encryption/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

/*
:Author: David Goodger ([email protected])
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.

See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -274,7 +275,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -300,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down
6 changes: 5 additions & 1 deletion g2p_registry_encryption/views/res_config_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
<field name="inherit_id" ref="base.res_config_settings_view_form" />
<field name="arch" type="xml">
<app name="g2p_config_settings" position="inside">
<block name="encryption_settings_container" title="G2P Registry Encryption Settings">
<block
name="encryption_settings_container"
title="G2P Registry Encryption Settings"
groups="g2p_encryption.crypto_admin"
>
<setting
string="Registry Encryption Provider Config"
help="Select the encryption provider to encrypt the registry"
Expand Down

0 comments on commit 7d65284

Please sign in to comment.