import{s as K,n as ee,o as te}from"../chunks/scheduler.9cda857a.js";import{S as se,i as ne,e as l,s as a,c as P,h as ae,a as r,d as s,b as i,f as D,g as z,j as M,k as Y,l as ie,m as n,n as N,t as V,o as X,p as W}from"../chunks/index.003612b0.js";import{C as le}from"../chunks/CopyLLMTxtMenu.44d08a39.js";import{C as re}from"../chunks/CodeBlock.a90632f1.js";import{H as oe,E as pe}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.e5cfda8c.js";function ce(q){let o,_,$,x,c,k,m,C,f,G='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.',b,u,Q="For example, this is what a compromised <code>app.py</code> file might look like:",j,h,H,d,Z='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.',U,p,F='<img class="block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/token-leak-email-example.png"/>',B,y,R="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.",J,w,O="TruffleHog can verify secrets that work across multiple services, it is not restricted to Hugging Face tokens.",L,v,A='You can opt-out from those email notifications from <a href="https://huggingface.co/settings/notifications" rel="nofollow">your settings</a>.',S,g,E,T,I;return c=new le({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),m=new oe({props:{title:"Secrets Scanning",local:"secrets-scanning",headingTag:"h1"}}),h=new re({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}}),g=new pe({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/security-secrets.md"}}),{c(){o=l("meta"),_=a(),$=l("p"),x=a(),P(c.$$.fragment),k=a(),P(m.$$.fragment),C=a(),f=l("p"),f.innerHTML=G,b=a(),u=l("p"),u.innerHTML=Q,j=a(),P(h.$$.fragment),H=a(),d=l("p"),d.innerHTML=Z,U=a(),p=l("div"),p.innerHTML=F,B=a(),y=l("p"),y.textContent=R,J=a(),w=l("p"),w.textContent=O,L=a(),v=l("p"),v.innerHTML=A,S=a(),P(g.$$.fragment),E=a(),T=l("p"),this.h()},l(e){const t=ae("svelte-u9bgzb",document.head);o=r(t,"META",{name:!0,content:!0}),t.forEach(s),_=i(e),$=r(e,"P",{}),D($).forEach(s),x=i(e),z(c.$$.fragment,e),k=i(e),z(m.$$.fragment,e),C=i(e),f=r(e,"P",{"data-svelte-h":!0}),M(f)!=="svelte-142d4nj"&&(f.innerHTML=G),b=i(e),u=r(e,"P",{"data-svelte-h":!0}),M(u)!=="svelte-2m5fq4"&&(u.innerHTML=Q),j=i(e),z(h.$$.fragment,e),H=i(e),d=r(e,"P",{"data-svelte-h":!0}),M(d)!=="svelte-mg24v5"&&(d.innerHTML=Z),U=i(e),p=r(e,"DIV",{class:!0,"data-svelte-h":!0}),M(p)!=="svelte-aoms5u"&&(p.innerHTML=F),B=i(e),y=r(e,"P",{"data-svelte-h":!0}),M(y)!=="svelte-uwm6qx"&&(y.textContent=R),J=i(e),w=r(e,"P",{"data-svelte-h":!0}),M(w)!=="svelte-1x2vtrr"&&(w.textContent=O),L=i(e),v=r(e,"P",{"data-svelte-h":!0}),M(v)!=="svelte-dsdbhj"&&(v.innerHTML=A),S=i(e),z(g.$$.fragment,e),E=i(e),T=r(e,"P",{}),D(T).forEach(s),this.h()},h(){Y(o,"name","hf:doc:metadata"),Y(o,"content",me),Y(p,"class","flex justify-center")},m(e,t){ie(document.head,o),n(e,_,t),n(e,$,t),n(e,x,t),N(c,e,t),n(e,k,t),N(m,e,t),n(e,C,t),n(e,f,t),n(e,b,t),n(e,u,t),n(e,j,t),N(h,e,t),n(e,H,t),n(e,d,t),n(e,U,t),n(e,p,t),n(e,B,t),n(e,y,t),n(e,J,t),n(e,w,t),n(e,L,t),n(e,v,t),n(e,S,t),N(g,e,t),n(e,E,t),n(e,T,t),I=!0},p:ee,i(e){I||(V(c.$$.fragment,e),V(m.$$.fragment,e),V(h.$$.fragment,e),V(g.$$.fragment,e),I=!0)},o(e){X(c.$$.fragment,e),X(m.$$.fragment,e),X(h.$$.fragment,e),X(g.$$.fragment,e),I=!1},d(e){e&&(s(_),s($),s(x),s(k),s(C),s(f),s(b),s(u),s(j),s(H),s(d),s(U),s(p),s(B),s(y),s(J),s(w),s(L),s(v),s(S),s(E),s(T)),s(o),W(c,e),W(m,e),W(h,e),W(g,e)}}}const me='{"title":"Secrets Scanning","local":"secrets-scanning","sections":[],"depth":1}';function fe(q){return te(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ve extends se{constructor(o){super(),ne(this,o,fe,ce,K,{})}}export{ve as component};
