import{s as W,n as q,o as G}from"../chunks/scheduler.d6170356.js";import{S as Q,i as Z,g as h,s as i,r as x,A as R,h as f,f as s,c as l,j as N,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,c,b,o,L='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>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:",k,m,v,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.",$,r,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,d,j,g,U;return c=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}}),d=new O({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/security-secrets.md"}}),{c(){n=h("meta"),w=i(),y=h("p"),M=i(),x(c.$$.fragment),b=i(),o=h("p"),o.innerHTML=L,_=i(),p=h("p"),p.innerHTML=P,k=i(),x(m.$$.fragment),v=i(),u=h("p"),u.textContent=V,$=i(),r=h("div"),r.innerHTML=X,T=i(),x(d.$$.fragment),j=i(),g=h("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",{}),N(y).forEach(s),M=l(e),B(c.$$.fragment,e),b=l(e),o=f(e,"P",{"data-svelte-h":!0}),C(o)!=="svelte-y3kbib"&&(o.innerHTML=L),_=l(e),p=f(e,"P",{"data-svelte-h":!0}),C(p)!=="svelte-2m5fq4"&&(p.innerHTML=P),k=l(e),B(m.$$.fragment,e),v=l(e),u=f(e,"P",{"data-svelte-h":!0}),C(u)!=="svelte-o1ec9y"&&(u.textContent=V),$=l(e),r=f(e,"DIV",{class:!0,"data-svelte-h":!0}),C(r)!=="svelte-ivq0bg"&&(r.innerHTML=X),T=l(e),B(d.$$.fragment,e),j=l(e),g=f(e,"P",{}),N(g).forEach(s),this.h()},h(){H(n,"name","hf:doc:metadata"),H(n,"content",K),H(r,"class","flex justify-center")},m(e,t){Y(document.head,n),a(e,w,t),a(e,y,t),a(e,M,t),J(c,e,t),a(e,b,t),a(e,o,t),a(e,_,t),a(e,p,t),a(e,k,t),J(m,e,t),a(e,v,t),a(e,u,t),a(e,$,t),a(e,r,t),a(e,T,t),J(d,e,t),a(e,j,t),a(e,g,t),U=!0},p:q,i(e){U||(S(c.$$.fragment,e),S(m.$$.fragment,e),S(d.$$.fragment,e),U=!0)},o(e){E(c.$$.fragment,e),E(m.$$.fragment,e),E(d.$$.fragment,e),U=!1},d(e){e&&(s(w),s(y),s(M),s(b),s(o),s(_),s(p),s(k),s(v),s(u),s($),s(r),s(T),s(j),s(g)),s(n),I(c,e),I(m,e),I(d,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,W,{})}}export{ie as component};
