Skip to content

Commit

Permalink
improve: add validation, parse secret words and update the README
Browse files Browse the repository at this point in the history
  • Loading branch information
daniloargentiero committed Jul 20, 2021
1 parent 7efbed2 commit c3c7c74
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Model/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function getSecrets(): array
self::WEBAPI_LOGS_LOG_SECRET_WORDS,
ScopeInterface::SCOPE_WEBSITE
);
return explode(PHP_EOL, $secrets);
return preg_split('/\n|\r\n?/', $secrets);
}

/**
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ You can select an entry to see more details about the request and the response

# Attention!

Enable this module only for debug reason, please don't let it enabled in production environment because it can slow down all your webapi request and overload your database.

This module logs everything passes in the webapi calls (tokens and passwords too!), remember to clean logs by clicking the `Delete All Logs` button:
If you disable the Secret Mode Enable this module logs everything passes in the webapi calls (tokens and passwords too!), then remember to clean logs by clicking the `Delete All Logs` button:

<img src="https://github.com/ghostunicorns/module-webapi-logs/blob/main/screenshots/screen4.png" />

Expand Down
1 change: 1 addition & 0 deletions etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<depends>
<field id="webapi_logs/log/enabled">1</field>
</depends>
<validate>validate-number validate-greater-than-zero</validate>
</field>
</group>
</section>
Expand Down
Binary file modified screenshots/screen1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c3c7c74

Please sign in to comment.