<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap:break-word;line-break:after-white-space"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">VCR offers support for this with the `filter_sensitive_data` option. I tend to loop through all of my env vars as filter them all out like so:</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">```</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><table class="highlight tab-size js-file-line-container"><tbody><tr><td id="LC3" class="blob-code blob-code-inner js-file-line">dotenv <span class="pl-k">=</span> <span class="pl-c1">Rails</span>.root.join(<span class="pl-s"><span class="pl-pds">'</span>.env<span class="pl-pds">'</span></span>)</td>
</tr>
<tr>
</tr></tbody></table>filter_vars <span class="pl-k">=</span> <span class="pl-c1">File</span>.exist?(dotenv) <span class="pl-k">?</span> <span class="pl-c1">Dotenv</span>::<span class="pl-c1">Environment</span>.<span class="pl-k">new</span>(dotenv, <span class="pl-c1">false</span>) : <span class="pl-c1">ENV</span></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><span class="pl-c1"><br></span></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><span class="pl-c1"><br></span></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><span class="pl-c1"><span class="pl-c1">VCR</span>.configure <span class="pl-k">do</span> |<span class="pl-smi">c</span>|</span> </div><table class="highlight tab-size js-file-line-container"><tbody><tr><td id="LC11" class="blob-code blob-code-inner js-file-line"> filter_vars.each <span class="pl-k">do</span> |<span class="pl-smi">key</span>, <span class="pl-smi">value</span>|</td>
</tr>
<tr>
</tr></tbody></table><table class="highlight tab-size js-file-line-container"><tbody><tr><td id="LC12" class="blob-code blob-code-inner js-file-line"> c.filter_sensitive_data(<span class="pl-s"><span class="pl-pds">"</span><<span class="pl-pse">#{</span><span class="pl-s1">key</span><span class="pl-pse">}</span>><span class="pl-pds">"</span></span>) { value }</td>
</tr>
<tr>
</tr></tbody></table> <span class="pl-k"> end</span><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><span class="pl-c1">end</span></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">```</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">This way, any credentials you have in your .env file (assuming you’re using dotenv) automatically get filtered out.</div> <br> <div id="bloop_sign_1536680675982982144" class="bloop_sign"></div> <br><p class="airmail_on">On 11 September 2018 at 16:43:35, Matthew Rudy Jacobs (<a href="mailto:matthewrudyjacobs@gmail.com">matthewrudyjacobs@gmail.com</a>) wrote:</p> <blockquote type="cite" class="clean_bq"><span><div><div></div><div>
<title></title>
<div dir="ltr">As it happens VCR cassettes accept ERB tags.
<div><br></div>
<div>So I once wrote a script to regenerate cassettes using real
credentials,</div>
<div>then right afterwards replace the credentials in the cassettes
with an ERB reference.</div>
<div><br></div>
<div>It's risky that you'll mess it up,</div>
<div>but it worked for my needs.</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr">On Tue, 11 Sep 2018 at 16:32, Toby Privett
<<a href="mailto:toby@snaplab.co.uk">toby@snaplab.co.uk</a>>
wrote:<br></div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">On a tangent, I once let API credentials leak into
VCR yaml files. Then pushed them to an open source repo.
<div>You're probably not doing that, but worth being mindful of the
risks</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr">On Tue, 11 Sep 2018 at 11:07 James Adam <<a href="mailto:james@lazyatom.com" target="_blank">james@lazyatom.com</a>> wrote:<br></div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word;line-break:after-white-space">On
11 Sep 2018, at 10:07, Samuel Joseph <<a href="mailto:tansaku@gmail.com" target="_blank">tansaku@gmail.com</a>> wrote:<br></div>
<div style="word-wrap:break-word;line-break:after-white-space">
<div>
<blockquote type="cite"><br class="m_-4388816819597740202m_-2546526929251259078Apple-interchange-newline">
<div>
<div>I have two concerns<br>
<br>
1) new developers onboarding often get snarled up in the caching
and the files generated<br></div>
</div>
</blockquote>
<div><br></div>
</div>
</div>
<div style="word-wrap:break-word;line-break:after-white-space">
<div>
<div>I tend to consider the generated YAML files as black boxes —
it’s hard to predict their contents or make much sense of them
until you’re quite experienced.</div>
</div>
</div>
<div style="word-wrap:break-word;line-break:after-white-space">
<div><br>
<blockquote type="cite">
<div>
<div>2) the cached recordings are gradually getting further and
further out of date - could we automate their
refreshing?<br></div>
</div>
</blockquote>
</div>
</div>
<div style="word-wrap:break-word;line-break:after-white-space">
<br>
<div>VCR _can_ be configured to automatically re-record after a
fixed period of time, would that help? <a href="https://relishapp.com/vcr/vcr/v/3-0-3/docs/cassettes/automatic-re-recording" target="_blank">https://relishapp.com/vcr/vcr/v/3-0-3/docs/cassettes/automatic-re-recording</a></div>
</div>
<div style="word-wrap:break-word;line-break:after-white-space">
<div><br></div>
<div>— James</div>
</div>
_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org" target="_blank">Chat@lists.lrug.org</a><br>
Archives: <a href="http://lists.lrug.org/pipermail/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/pipermail/chat-lrug.org</a><br>
Manage your subscription: <a href="http://lists.lrug.org/options.cgi/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/options.cgi/chat-lrug.org</a><br>
List info: <a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br></blockquote>
</div>
--<br>
<div dir="ltr" class="m_-4388816819597740202gmail_signature" data-smartmail="gmail_signature">
<div dir="ltr">
<div>Kind regards,</div>
<div><br></div>
Toby Privett
<div>--------------</div>
<div>
<div><a href="http://snaplab.co.uk" target="_blank">http://snaplab.co.uk</a></div>
</div>
</div>
</div>
_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org" target="_blank">Chat@lists.lrug.org</a><br>
Archives: <a href="http://lists.lrug.org/pipermail/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/pipermail/chat-lrug.org</a><br>
Manage your subscription: <a href="http://lists.lrug.org/options.cgi/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/options.cgi/chat-lrug.org</a><br>
List info: <a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br></blockquote>
</div>
_______________________________________________
<br>Chat mailing list
<br><a href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a>
<br>Archives: <a href="http://lists.lrug.org/pipermail/chat-lrug.org">http://lists.lrug.org/pipermail/chat-lrug.org</a>
<br>Manage your subscription: <a href="http://lists.lrug.org/options.cgi/chat-lrug.org">http://lists.lrug.org/options.cgi/chat-lrug.org</a>
<br>List info: <a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a>
<br></div></div></span></blockquote></body></html>