import{s as X,n as N,o as W}from"../chunks/scheduler.d6170356.js";import{S as q,i as Q,g as h,s as i,r as S,A as Z,h as u,f as s,c,j as I,u as z,x as U,k as C,y as G,a,v as E,d as L,t as P,w as V}from"../chunks/index.fcd4cc08.js";import{C as R}from"../chunks/CodeBlock.7b16bdef.js";import{H as Y}from"../chunks/Heading.8660bd0e.js";function F(x){let n,w,f,g,r,M,o,$='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,B="For example, this is what a compromised <code>app.py</code> file might look like:",k,m,v,d,H="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.",b,l,J='<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,y,j;return r=new Y({props:{title:"Secrets Scanning",local:"secrets-scanning",headingTag:"h1"}}),m=new R({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}}),{c(){n=h("meta"),w=i(),f=h("p"),g=i(),S(r.$$.fragment),M=i(),o=h("p"),o.innerHTML=$,_=i(),p=h("p"),p.innerHTML=B,k=i(),S(m.$$.fragment),v=i(),d=h("p"),d.textContent=H,b=i(),l=h("div"),l.innerHTML=J,T=i(),y=h("p"),this.h()},l(e){const t=Z("svelte-u9bgzb",document.head);n=u(t,"META",{name:!0,content:!0}),t.forEach(s),w=c(e),f=u(e,"P",{}),I(f).forEach(s),g=c(e),z(r.$$.fragment,e),M=c(e),o=u(e,"P",{"data-svelte-h":!0}),U(o)!=="svelte-y3kbib"&&(o.innerHTML=$),_=c(e),p=u(e,"P",{"data-svelte-h":!0}),U(p)!=="svelte-2m5fq4"&&(p.innerHTML=B),k=c(e),z(m.$$.fragment,e),v=c(e),d=u(e,"P",{"data-svelte-h":!0}),U(d)!=="svelte-o1ec9y"&&(d.textContent=H),b=c(e),l=u(e,"DIV",{class:!0,"data-svelte-h":!0}),U(l)!=="svelte-ivq0bg"&&(l.innerHTML=J),T=c(e),y=u(e,"P",{}),I(y).forEach(s),this.h()},h(){C(n,"name","hf:doc:metadata"),C(n,"content",A),C(l,"class","flex justify-center")},m(e,t){G(document.head,n),a(e,w,t),a(e,f,t),a(e,g,t),E(r,e,t),a(e,M,t),a(e,o,t),a(e,_,t),a(e,p,t),a(e,k,t),E(m,e,t),a(e,v,t),a(e,d,t),a(e,b,t),a(e,l,t),a(e,T,t),a(e,y,t),j=!0},p:N,i(e){j||(L(r.$$.fragment,e),L(m.$$.fragment,e),j=!0)},o(e){P(r.$$.fragment,e),P(m.$$.fragment,e),j=!1},d(e){e&&(s(w),s(f),s(g),s(M),s(o),s(_),s(p),s(k),s(v),s(d),s(b),s(l),s(T),s(y)),s(n),V(r,e),V(m,e)}}}const A='{"title":"Secrets Scanning","local":"secrets-scanning","sections":[],"depth":1}';function D(x){return W(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class se extends q{constructor(n){super(),Q(this,n,D,F,X,{})}}export{se as component};
