Skip to content

Commit

Permalink
Merge pull request #9 from salemove/glia-prune-connected-to-token
Browse files Browse the repository at this point in the history
Prune access tokens in "connected to" logs
  • Loading branch information
sviik authored Dec 12, 2023
2 parents 1c8156a + 9d2d91e commit d33abf4
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 12 deletions.
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.

0 comments on commit d33abf4

Please sign in to comment.