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

Commit

Permalink
Fixed crypto admin group access and fixed update prov bug
Browse files Browse the repository at this point in the history
Signed-off-by: Lalith Kota <[email protected]>
  • Loading branch information
lalithkota committed Apr 22, 2024
1 parent 7e84f56 commit 66f5a00
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 48 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
2 changes: 1 addition & 1 deletion g2p_registry_encryption/models/partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ 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())

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
72 changes: 37 additions & 35 deletions g2p_registry_encryption/views/res_config_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,45 @@
<field name="inherit_id" ref="base.res_config_settings_view_form" />
<field name="arch" type="xml">
<xpath expr="//div[@id='g2p_config_settings']" position="inside">
<h2>G2P Registry Encryption Settings</h2>
<div class="row mt16 o_settings_container" name="encryption_settings_container">
<div
class="col-12 col-lg-6 o_setting_box"
id="registry_encryption_provider_config"
title="Registry Encryption Provider Config"
>
<div class="o_setting_right_pane">
<label
for="registry_encryption_provider"
string="Encryption Provider for Registry"
/>
<field name="registry_encryption_provider" />
<div name="encryption_settings_block" groups="g2p_encryption.crypto_admin">
<h2>G2P Registry Encryption Settings</h2>
<div class="row mt16 o_settings_container" name="encryption_settings_block">
<div
class="col-12 col-lg-6 o_setting_box"
id="registry_encryption_provider_config"
title="Registry Encryption Provider Config"
>
<div class="o_setting_right_pane">
<label
for="registry_encryption_provider"
string="Encryption Provider for Registry"
/>
<field name="registry_encryption_provider" />
</div>
</div>
</div>
<div
class="col-12 col-lg-6 o_setting_box"
id="encrypt_registry_config"
title="Encrypt Registry Config"
>
<div class="o_setting_right_pane">
<field name="encrypt_registry" />
<label for="encrypt_registry" string="Encrypt Registry fields" />
<span class="text-muted">This option enables registry fields encryption</span>
<div
class="col-12 col-lg-6 o_setting_box"
id="encrypt_registry_config"
title="Encrypt Registry Config"
>
<div class="o_setting_right_pane">
<field name="encrypt_registry" />
<label for="encrypt_registry" string="Encrypt Registry fields" />
<span class="text-muted">This option enables registry fields encryption</span>
</div>
</div>
</div>
<div
class="col-12 col-lg-6 o_setting_box"
id="decrypt_registry_config"
title="Decrypt Registry Config"
>
<div class="o_setting_right_pane">
<field name="decrypt_registry" />
<label for="decrypt_registry" string="Decrypt Registry fields" />
<span
class="text-muted"
>By choosing this, you are consenting to decrypting fields on registry. So be careful</span>
<div
class="col-12 col-lg-6 o_setting_box"
id="decrypt_registry_config"
title="Decrypt Registry Config"
>
<div class="o_setting_right_pane">
<field name="decrypt_registry" />
<label for="decrypt_registry" string="Decrypt Registry fields" />
<span
class="text-muted"
>By choosing this, you are consenting to decrypting fields on registry. So be careful</span>
</div>
</div>
</div>
</div>
Expand Down

0 comments on commit 66f5a00

Please sign in to comment.