Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prune access tokens in "connected to" logs #9

Merged
merged 2 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion assets/js/phoenix/socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,11 @@ export default class Socket {
}

onConnOpen(){
if(this.hasLogger()) this.log("transport", `connected to ${this.endPointURL()}`)
if(this.hasLogger()) {
const endPointURL = this.endPointURL()
const prunedURL = endPointURL.replace(/access_token=([^&#/]+)/, 'access_token=-pruned-')
this.log("transport", `connected to ${prunedURL}`)
}
this.closeWasClean = false
this.establishedConnections++
this.flushSendBuffer()
Expand Down
7 changes: 5 additions & 2 deletions priv/static/phoenix.cjs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions priv/static/phoenix.cjs.js.map

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions priv/static/phoenix.js
Original file line number Diff line number Diff line change
Expand Up @@ -1030,8 +1030,11 @@ var Phoenix = (() => {
clearTimeout(this.heartbeatTimeoutTimer);
}
onConnOpen() {
if (this.hasLogger())
this.log("transport", `connected to ${this.endPointURL()}`);
if (this.hasLogger()) {
const endPointURL = this.endPointURL();
const prunedURL = endPointURL.replace(/access_token=([^&#/]+)/, "access_token=-pruned-");
this.log("transport", `connected to ${prunedURL}`);
}
this.closeWasClean = false;
this.establishedConnections++;
this.flushSendBuffer();
Expand Down
2 changes: 1 addition & 1 deletion priv/static/phoenix.min.js

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions priv/static/phoenix.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1001,8 +1001,11 @@ var Socket = class {
clearTimeout(this.heartbeatTimeoutTimer);
}
onConnOpen() {
if (this.hasLogger())
this.log("transport", `connected to ${this.endPointURL()}`);
if (this.hasLogger()) {
const endPointURL = this.endPointURL();
const prunedURL = endPointURL.replace(/access_token=([^&#/]+)/, "access_token=-pruned-");
this.log("transport", `connected to ${prunedURL}`);
}
this.closeWasClean = false;
this.establishedConnections++;
this.flushSendBuffer();
Expand Down
4 changes: 2 additions & 2 deletions priv/static/phoenix.mjs.map

Large diffs are not rendered by default.

Loading