import{s as Q,n as Z,o as q}from"../chunks/scheduler.d6170356.js";import{S as O,i as R,g as r,s as n,r as B,A as F,h as o,f as s,c as i,j as Y,u as J,x as v,k as G,y as A,a,v as S,d as E,t as I,w as L}from"../chunks/index.fcd4cc08.js";import{C as D}from"../chunks/CodeBlock.7b16bdef.js";import{H as K,E as ee}from"../chunks/EditOnGithub.da2b595c.js";function te(P){let l,g,w,T,c,_,p,z='It is important to manage <a href="./spaces-overview#managing-secrets-and-environment-variables">your secrets (env variables) properly</a>. The most common way people expose their secrets to the outside world is by hard-coding their secrets in their code files directly, which makes it possible for a malicious user to utilize your secrets and services your secrets have access to.',$,m,N="For example, this is what a compromised <code>app.py</code> file might look like:",b,f,j,u,V='To prevent this issue, we run a tool called <a href="https://trufflesecurity.com/trufflehog" rel="nofollow">TruffleHog</a> on each push you make. TruffleHog scans for hard-coded secrets and we will send you an email upon detection. You’ll only receive an email for verified secrets. Verified secrets are secrets that have been verified by trufflehog, meaning that they can be used to authenticate to their given provider. Note that unverified secrets are not necessarily invalid, verification can also fail due to technical reasons, e.g. in that case of a network error.',k,h,X='You can opt-out from those email notifications from <a href="https://huggingface.co/settings/notifications" rel="nofollow">your settings</a>.',C,d,W="TODO: add a picture of the email?",H,y,U,M,x;return c=new K({props:{title:"Secrets Scanning",local:"secrets-scanning",headingTag:"h1"}}),f=new D({props:{code:"aW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBaW1wb3J0JTIwc2NpcHklMjBhcyUyMHNwJTBBJTBBYXBpX2tleSUyMCUzRCUyMCUyMnN3LXh5ejEyMzQ1Njc4OTEyMTMlMjIlMEElMEFkZWYlMjBjYWxsX2luZmVyZW5jZShwcm9tcHQlM0ElMjBzdHIpJTIwLSUzRSUyMHN0ciUzQSUwQSUyMCUyMCUyMCUyMHJlc3VsdCUyMCUzRCUyMGNhbGxfYXBpKHByb21wdCUyQyUyMGFwaV9rZXkpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwcmVzdWx0",highlighted:`<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-keyword">import</span> scipy <span class="hljs-keyword">as</span> sp

api_key = <span class="hljs-string">&quot;sw-xyz1234567891213&quot;</span>

<span class="hljs-keyword">def</span> <span class="hljs-title function_">call_inference</span>(<span class="hljs-params">prompt: <span class="hljs-built_in">str</span></span>) -&gt; <span class="hljs-built_in">str</span>:
    result = call_api(prompt, api_key)
    <span class="hljs-keyword">return</span> result`,wrap:!1}}),y=new ee({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/security-secrets.md"}}),{c(){l=r("meta"),g=n(),w=r("p"),T=n(),B(c.$$.fragment),_=n(),p=r("p"),p.innerHTML=z,$=n(),m=r("p"),m.innerHTML=N,b=n(),B(f.$$.fragment),j=n(),u=r("p"),u.innerHTML=V,k=n(),h=r("p"),h.innerHTML=X,C=n(),d=r("p"),d.textContent=W,H=n(),B(y.$$.fragment),U=n(),M=r("p"),this.h()},l(e){const t=F("svelte-u9bgzb",document.head);l=o(t,"META",{name:!0,content:!0}),t.forEach(s),g=i(e),w=o(e,"P",{}),Y(w).forEach(s),T=i(e),J(c.$$.fragment,e),_=i(e),p=o(e,"P",{"data-svelte-h":!0}),v(p)!=="svelte-loyix7"&&(p.innerHTML=z),$=i(e),m=o(e,"P",{"data-svelte-h":!0}),v(m)!=="svelte-2m5fq4"&&(m.innerHTML=N),b=i(e),J(f.$$.fragment,e),j=i(e),u=o(e,"P",{"data-svelte-h":!0}),v(u)!=="svelte-ih3fgi"&&(u.innerHTML=V),k=i(e),h=o(e,"P",{"data-svelte-h":!0}),v(h)!=="svelte-dsdbhj"&&(h.innerHTML=X),C=i(e),d=o(e,"P",{"data-svelte-h":!0}),v(d)!=="svelte-1etpjd7"&&(d.textContent=W),H=i(e),J(y.$$.fragment,e),U=i(e),M=o(e,"P",{}),Y(M).forEach(s),this.h()},h(){G(l,"name","hf:doc:metadata"),G(l,"content",se)},m(e,t){A(document.head,l),a(e,g,t),a(e,w,t),a(e,T,t),S(c,e,t),a(e,_,t),a(e,p,t),a(e,$,t),a(e,m,t),a(e,b,t),S(f,e,t),a(e,j,t),a(e,u,t),a(e,k,t),a(e,h,t),a(e,C,t),a(e,d,t),a(e,H,t),S(y,e,t),a(e,U,t),a(e,M,t),x=!0},p:Z,i(e){x||(E(c.$$.fragment,e),E(f.$$.fragment,e),E(y.$$.fragment,e),x=!0)},o(e){I(c.$$.fragment,e),I(f.$$.fragment,e),I(y.$$.fragment,e),x=!1},d(e){e&&(s(g),s(w),s(T),s(_),s(p),s($),s(m),s(b),s(j),s(u),s(k),s(h),s(C),s(d),s(H),s(U),s(M)),s(l),L(c,e),L(f,e),L(y,e)}}}const se='{"title":"Secrets Scanning","local":"secrets-scanning","sections":[],"depth":1}';function ae(P){return q(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class oe extends O{constructor(l){super(),R(this,l,ae,te,Q,{})}}export{oe as component};
