import{s as N,n as W,o as G}from"../chunks/scheduler.d6170356.js";import{S as Q,i as Z,g as d,s as i,r as x,A as R,h as f,f as s,c as l,j as q,u as B,x as C,k as H,y as Y,a,v as J,d as S,t as E,w as I}from"../chunks/index.fcd4cc08.js";import{C as F}from"../chunks/CodeBlock.7b16bdef.js";import{H as A,E as O}from"../chunks/EditOnGithub.da2b595c.js";function D(z){let n,w,y,M,r,b,o,L='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>app.py</code> files directly, which makes it possible for a malicious user to utilize your secrets and services your secrets have access to.',_,p,P="For example, this is what a compromised <code>app.py</code> file might look like:",$,m,k,u,V="To prevent this issue, we run an automated bot (Spaces Secrets Scanner) that scans for hard-coded secrets and opens a discussion (in case hard-coded secrets are found) about the exposed secrets & how to handle this problem.",v,c,X='<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/token-scanner-light.png"/> <img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/token-scanner-dark.png"/>',T,h,j,g,U;return r=new A({props:{title:"Secrets Scanning",local:"secrets-scanning",headingTag:"h1"}}),m=new F({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}}),h=new O({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/security-secrets.md"}}),{c(){n=d("meta"),w=i(),y=d("p"),M=i(),x(r.$$.fragment),b=i(),o=d("p"),o.innerHTML=L,_=i(),p=d("p"),p.innerHTML=P,$=i(),x(m.$$.fragment),k=i(),u=d("p"),u.textContent=V,v=i(),c=d("div"),c.innerHTML=X,T=i(),x(h.$$.fragment),j=i(),g=d("p"),this.h()},l(e){const t=R("svelte-u9bgzb",document.head);n=f(t,"META",{name:!0,content:!0}),t.forEach(s),w=l(e),y=f(e,"P",{}),q(y).forEach(s),M=l(e),B(r.$$.fragment,e),b=l(e),o=f(e,"P",{"data-svelte-h":!0}),C(o)!=="svelte-19q90e3"&&(o.innerHTML=L),_=l(e),p=f(e,"P",{"data-svelte-h":!0}),C(p)!=="svelte-2m5fq4"&&(p.innerHTML=P),$=l(e),B(m.$$.fragment,e),k=l(e),u=f(e,"P",{"data-svelte-h":!0}),C(u)!=="svelte-o1ec9y"&&(u.textContent=V),v=l(e),c=f(e,"DIV",{class:!0,"data-svelte-h":!0}),C(c)!=="svelte-ivq0bg"&&(c.innerHTML=X),T=l(e),B(h.$$.fragment,e),j=l(e),g=f(e,"P",{}),q(g).forEach(s),this.h()},h(){H(n,"name","hf:doc:metadata"),H(n,"content",K),H(c,"class","flex justify-center")},m(e,t){Y(document.head,n),a(e,w,t),a(e,y,t),a(e,M,t),J(r,e,t),a(e,b,t),a(e,o,t),a(e,_,t),a(e,p,t),a(e,$,t),J(m,e,t),a(e,k,t),a(e,u,t),a(e,v,t),a(e,c,t),a(e,T,t),J(h,e,t),a(e,j,t),a(e,g,t),U=!0},p:W,i(e){U||(S(r.$$.fragment,e),S(m.$$.fragment,e),S(h.$$.fragment,e),U=!0)},o(e){E(r.$$.fragment,e),E(m.$$.fragment,e),E(h.$$.fragment,e),U=!1},d(e){e&&(s(w),s(y),s(M),s(b),s(o),s(_),s(p),s($),s(k),s(u),s(v),s(c),s(T),s(j),s(g)),s(n),I(r,e),I(m,e),I(h,e)}}}const K='{"title":"Secrets Scanning","local":"secrets-scanning","sections":[],"depth":1}';function ee(z){return G(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ie extends Q{constructor(n){super(),Z(this,n,ee,D,N,{})}}export{ie as component};
