import{s as O,n as D,o as K}from"../chunks/scheduler.d6170356.js";import{S as ee,i as te,g as l,s as n,r as E,A as se,h as r,f as s,c as i,j as A,u as I,x as g,k as P,y as ae,a,v as z,d as N,t as V,w as X}from"../chunks/index.fcd4cc08.js";import{C as ne}from"../chunks/CodeBlock.db16bf50.js";import{H as ie,E as le}from"../chunks/index.9f2da87a.js";function re(W){let o,_,M,k,p,$,m,Y='It is important to manage <a href="./spaces-overview#managing-secrets">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.',x,u,q="For example, this is what a compromised <code>app.py</code> file might look like:",b,f,j,h,G='To prevent this issue, we run <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.',C,c,Q='<img class="block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/token-leak-email-example.png"/>',H,d,Z="You’ll only receive emails for verified secrets, which are the ones that have been confirmed to work for authentication against their respective providers. Note, however, that unverified secrets are not necessarily harmless or invalid: verification can fail due to technical reasons, such as in the case of a network error.",U,y,F="TruffleHog can verify secrets that work across multiple services, it is not restricted to Hugging Face tokens.",B,w,R='You can opt-out from those email notifications from <a href="https://huggingface.co/settings/notifications" rel="nofollow">your settings</a>.',J,v,L,T,S;return p=new ie({props:{title:"Secrets Scanning",local:"secrets-scanning",headingTag:"h1"}}),f=new ne({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}}),v=new le({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/security-secrets.md"}}),{c(){o=l("meta"),_=n(),M=l("p"),k=n(),E(p.$$.fragment),$=n(),m=l("p"),m.innerHTML=Y,x=n(),u=l("p"),u.innerHTML=q,b=n(),E(f.$$.fragment),j=n(),h=l("p"),h.innerHTML=G,C=n(),c=l("div"),c.innerHTML=Q,H=n(),d=l("p"),d.textContent=Z,U=n(),y=l("p"),y.textContent=F,B=n(),w=l("p"),w.innerHTML=R,J=n(),E(v.$$.fragment),L=n(),T=l("p"),this.h()},l(e){const t=se("svelte-u9bgzb",document.head);o=r(t,"META",{name:!0,content:!0}),t.forEach(s),_=i(e),M=r(e,"P",{}),A(M).forEach(s),k=i(e),I(p.$$.fragment,e),$=i(e),m=r(e,"P",{"data-svelte-h":!0}),g(m)!=="svelte-142d4nj"&&(m.innerHTML=Y),x=i(e),u=r(e,"P",{"data-svelte-h":!0}),g(u)!=="svelte-2m5fq4"&&(u.innerHTML=q),b=i(e),I(f.$$.fragment,e),j=i(e),h=r(e,"P",{"data-svelte-h":!0}),g(h)!=="svelte-mg24v5"&&(h.innerHTML=G),C=i(e),c=r(e,"DIV",{class:!0,"data-svelte-h":!0}),g(c)!=="svelte-aoms5u"&&(c.innerHTML=Q),H=i(e),d=r(e,"P",{"data-svelte-h":!0}),g(d)!=="svelte-uwm6qx"&&(d.textContent=Z),U=i(e),y=r(e,"P",{"data-svelte-h":!0}),g(y)!=="svelte-1x2vtrr"&&(y.textContent=F),B=i(e),w=r(e,"P",{"data-svelte-h":!0}),g(w)!=="svelte-dsdbhj"&&(w.innerHTML=R),J=i(e),I(v.$$.fragment,e),L=i(e),T=r(e,"P",{}),A(T).forEach(s),this.h()},h(){P(o,"name","hf:doc:metadata"),P(o,"content",oe),P(c,"class","flex justify-center")},m(e,t){ae(document.head,o),a(e,_,t),a(e,M,t),a(e,k,t),z(p,e,t),a(e,$,t),a(e,m,t),a(e,x,t),a(e,u,t),a(e,b,t),z(f,e,t),a(e,j,t),a(e,h,t),a(e,C,t),a(e,c,t),a(e,H,t),a(e,d,t),a(e,U,t),a(e,y,t),a(e,B,t),a(e,w,t),a(e,J,t),z(v,e,t),a(e,L,t),a(e,T,t),S=!0},p:D,i(e){S||(N(p.$$.fragment,e),N(f.$$.fragment,e),N(v.$$.fragment,e),S=!0)},o(e){V(p.$$.fragment,e),V(f.$$.fragment,e),V(v.$$.fragment,e),S=!1},d(e){e&&(s(_),s(M),s(k),s($),s(m),s(x),s(u),s(b),s(j),s(h),s(C),s(c),s(H),s(d),s(U),s(y),s(B),s(w),s(J),s(L),s(T)),s(o),X(p,e),X(f,e),X(v,e)}}}const oe='{"title":"Secrets Scanning","local":"secrets-scanning","sections":[],"depth":1}';function ce(W){return K(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class he extends ee{constructor(o){super(),te(this,o,ce,re,O,{})}}export{he as component};
