import{S as fe,i as ye,s as we,e as r,k as w,w as ie,t as p,N as ve,c as o,d as s,m as v,a as c,x as le,h,b as n,P as pe,G as t,g as i,y as he,L as _e,q as de,o as me,B as ue,v as ge}from"../chunks/vendor-hf-doc-builder.js";import{I as ke}from"../chunks/IconCopyLink-hf-doc-builder.js";import{C as be}from"../chunks/CodeBlock-hf-doc-builder.js";function Me(D){let d,$,m,f,E,_,V,U,X,B,l,q,k,W,A,T,L,Q,I,y,Z,x,F,O,J,g,C,b,R,z,u,M,K,Y,S,ee,N;return _=new ke({}),g=new be({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`}}),{c(){d=r("meta"),$=w(),m=r("h1"),f=r("a"),E=r("span"),ie(_.$$.fragment),V=w(),U=r("span"),X=p("Secrets Scanning"),B=w(),l=r("p"),q=p("It is important to manage "),k=r("a"),W=p("your secrets (env variables) properly"),A=p(". The most common way people expose their secrets to the outside world is by hard-coding their secrets in their "),T=r("code"),L=p("app.py"),Q=p(" files directly, which makes it possible for a malicious user to utilize your secrets and services your secrets have access to."),I=w(),y=r("p"),Z=p("For example, this is what a compromised "),x=r("code"),F=p("app.py"),O=p(" file might look like:"),J=w(),ie(g.$$.fragment),C=w(),b=r("p"),R=p("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."),z=w(),u=r("div"),M=r("img"),Y=w(),S=r("img"),this.h()},l(e){const a=ve('[data-svelte="svelte-1phssyn"]',document.head);d=o(a,"META",{name:!0,content:!0}),a.forEach(s),$=v(e),m=o(e,"H1",{class:!0});var H=c(m);f=o(H,"A",{id:!0,class:!0,href:!0});var se=c(f);E=o(se,"SPAN",{});var te=c(E);le(_.$$.fragment,te),te.forEach(s),se.forEach(s),V=v(H),U=o(H,"SPAN",{});var ae=c(U);X=h(ae,"Secrets Scanning"),ae.forEach(s),H.forEach(s),B=v(e),l=o(e,"P",{});var j=c(l);q=h(j,"It is important to manage "),k=o(j,"A",{href:!0});var re=c(k);W=h(re,"your secrets (env variables) properly"),re.forEach(s),A=h(j,". The most common way people expose their secrets to the outside world is by hard-coding their secrets in their "),T=o(j,"CODE",{});var oe=c(T);L=h(oe,"app.py"),oe.forEach(s),Q=h(j," files directly, which makes it possible for a malicious user to utilize your secrets and services your secrets have access to."),j.forEach(s),I=v(e),y=o(e,"P",{});var P=c(y);Z=h(P,"For example, this is what a compromised "),x=o(P,"CODE",{});var ne=c(x);F=h(ne,"app.py"),ne.forEach(s),O=h(P," file might look like:"),P.forEach(s),J=v(e),le(g.$$.fragment,e),C=v(e),b=o(e,"P",{});var ce=c(b);R=h(ce,"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."),ce.forEach(s),z=v(e),u=o(e,"DIV",{class:!0});var G=c(u);M=o(G,"IMG",{class:!0,src:!0}),Y=v(G),S=o(G,"IMG",{class:!0,src:!0}),G.forEach(s),this.h()},h(){n(d,"name","hf:doc:metadata"),n(d,"content",JSON.stringify(Se)),n(f,"id","secrets-scanning"),n(f,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),n(f,"href","#secrets-scanning"),n(m,"class","relative group"),n(k,"href","./spaces-overview#managing-secrets-and-environment-variables"),n(M,"class","block dark:hidden"),pe(M.src,K="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/token-scanner-light.png")||n(M,"src",K),n(S,"class","hidden dark:block"),pe(S.src,ee="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/token-scanner-dark.png")||n(S,"src",ee),n(u,"class","flex justify-center")},m(e,a){t(document.head,d),i(e,$,a),i(e,m,a),t(m,f),t(f,E),he(_,E,null),t(m,V),t(m,U),t(U,X),i(e,B,a),i(e,l,a),t(l,q),t(l,k),t(k,W),t(l,A),t(l,T),t(T,L),t(l,Q),i(e,I,a),i(e,y,a),t(y,Z),t(y,x),t(x,F),t(y,O),i(e,J,a),he(g,e,a),i(e,C,a),i(e,b,a),t(b,R),i(e,z,a),i(e,u,a),t(u,M),t(u,Y),t(u,S),N=!0},p:_e,i(e){N||(de(_.$$.fragment,e),de(g.$$.fragment,e),N=!0)},o(e){me(_.$$.fragment,e),me(g.$$.fragment,e),N=!1},d(e){s(d),e&&s($),e&&s(m),ue(_),e&&s(B),e&&s(l),e&&s(I),e&&s(y),e&&s(J),ue(g,e),e&&s(C),e&&s(b),e&&s(z),e&&s(u)}}}const Se={local:"secrets-scanning",title:"Secrets Scanning"};function je(D){return ge(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class xe extends fe{constructor(d){super();ye(this,d,je,Me,we,{})}}export{xe as default,Se as metadata};
