github.com/minio/console@v1.4.1/web-app/build/static/js/6925.b3e208b0.chunk.js (about)

     1  (self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[6925],{36925:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>A});var r=n(65043),o=n(73216),a=n(89923),s=n(77403),i=n(99161),c=n(64159),l=n(56629),d=n(53518),p=n(85330),u=n(41206),y=n(70579);const f=e=>{let{icon:t,description:n}=e;return(0,y.jsxs)(a.azJ,{sx:{display:"flex","& .min-icon":{marginRight:"10px",height:"23px",width:"23px",marginBottom:"10px"}},children:[t," ",(0,y.jsx)("div",{style:{fontSize:"14px",fontStyle:"italic",color:"#5E5E5E"},children:n})]})},h=()=>(0,y.jsxs)(a.azJ,{sx:{flex:1,border:"1px solid #eaeaea",borderRadius:"2px",display:"flex",flexFlow:"column",padding:"20px",marginTop:0},children:[(0,y.jsxs)(a.azJ,{sx:{fontSize:"16px",fontWeight:600,display:"flex",alignItems:"center",marginBottom:"16px",paddingBottom:"20px","& .min-icon":{height:"21px",width:"21px",marginRight:"15px"}},children:[(0,y.jsx)(a.nag,{}),(0,y.jsx)("div",{children:"Learn more about Access Keys"})]}),(0,y.jsxs)(a.azJ,{sx:{fontSize:"14px",marginBottom:"15px"},children:[(0,y.jsxs)(a.azJ,{sx:{paddingBottom:"20px"},children:[(0,y.jsx)(f,{icon:(0,y.jsx)(a.ehx,{}),description:"Create Access Keys"}),(0,y.jsx)(a.azJ,{sx:{paddingTop:"20px"},children:"Access Keys inherit the policies explicitly attached to the parent user, and the policies attached to each group in which the parent user has membership."})]}),(0,y.jsxs)(a.azJ,{sx:{paddingBottom:"20px"},children:[(0,y.jsx)(f,{icon:(0,y.jsx)(a.aJN,{}),description:"Assign Custom Credentials"}),(0,y.jsx)(a.azJ,{sx:{paddingTop:"10px"},children:"Randomized access credentials are recommended, and provided by default. You may use your own custom Access Key and Secret Key by replacing the default values. After creation of any Access Key, you will be given the opportunity to view and download the account credentials."}),(0,y.jsx)(a.azJ,{sx:{paddingTop:"10px"},children:"Access Keys support programmatic access by applications. You cannot use a Access Key to log into the MinIO Console."})]}),(0,y.jsxs)(a.azJ,{sx:{paddingBottom:"20px"},children:[(0,y.jsx)(f,{icon:(0,y.jsx)(a.n$X,{}),description:"Assign Access Policies"}),(0,y.jsx)(a.azJ,{sx:{paddingTop:"10px"},children:"You can specify an optional JSON-formatted IAM policy to further restrict Access Key access to a subset of the actions and resources explicitly allowed for the parent user. Additional access beyond that of the parent user cannot be implemented through these policies."}),(0,y.jsx)(a.azJ,{sx:{paddingTop:"10px"},children:"You cannot modify the optional Access Key IAM policy after saving."})]})]}),(0,y.jsx)(a.azJ,{sx:{display:"flex",flexFlow:"column"}})]});var x=n(78619),m=n(11441),g=n(48793),b=n(55968),j=n(20554),v=n(56483);const A=()=>{const e=(0,j.jL)(),t=(0,o.Zp)(),[n,f]=(0,r.useState)(!1),[A,C]=(0,r.useState)((0,v.$f)(20)),[w,S]=(0,r.useState)((0,v.$f)(40)),[K,O]=(0,r.useState)(!1),[E,P]=(0,r.useState)(null),[T,D]=(0,r.useState)(""),[J,k]=(0,r.useState)(""),[z,R]=(0,r.useState)(""),[_,B]=(0,r.useState)(""),[N,I]=(0,r.useState)();(0,r.useEffect)((()=>{e((0,c.ph)("add_service_account"))}),[]),(0,r.useEffect)((()=>{if(n){const t=N?N.toJSDate().toISOString():null;l.F.serviceAccountCredentials.createServiceAccountCreds({policy:T,accessKey:A,secretKey:w,description:z,comment:_,name:J,expiry:t},{type:p.cM.Json}).then((e=>{f(!1),P({accessKey:e.data.accessKey||"",secretKey:e.data.secretKey||"",url:e.url||""})})).catch((t=>{f(!1),e((0,c.C9)((0,d.S)(t.error)))}))}}),[n,f,e,T,A,w,J,z,N,_]),(0,r.useEffect)((()=>{K&&l.F.user.getUserPolicy().then((e=>{D(JSON.stringify(JSON.parse(e.data),null,4))}))}),[K]);return(0,y.jsxs)(r.Fragment,{children:[null!==E&&(0,y.jsx)(x.A,{newServiceAccount:E,open:!0,closeModal:()=>{P(null),t("".concat(i.zZ.ACCOUNT))},entity:"Access Key"}),(0,y.jsxs)(a.xA9,{item:!0,xs:12,children:[(0,y.jsx)(g.A,{label:(0,y.jsx)(a.EGL,{label:"Access Keys",onClick:()=>t(i.zZ.ACCOUNT)}),actions:(0,y.jsx)(b.A,{})}),(0,y.jsx)(a.Mxu,{children:(0,y.jsx)(a.Hbc,{helpBox:(0,y.jsx)(h,{}),icon:(0,y.jsx)(a.kQt,{}),title:"Create Access Key",children:(0,y.jsxs)("form",{noValidate:!0,autoComplete:"off",onSubmit:e=>{e.preventDefault(),(e=>{e.preventDefault(),f(!0)})(e)},children:[(0,y.jsx)(a.cl_,{value:A,label:"Access Key",id:"accessKey",name:"accessKey",placeholder:"Enter Access Key",onChange:e=>{C(e.target.value)},startIcon:(0,y.jsx)(a.ehx,{})}),(0,y.jsx)(a.cl_,{value:w,label:"Secret Key",id:"secretKey",name:"secretKey",type:"password",placeholder:"Enter Secret Key",onChange:e=>{S(e.target.value)},startIcon:(0,y.jsx)(a.aJN,{})}),(0,y.jsx)(a.dOG,{value:"serviceAccountPolicy",id:"serviceAccountPolicy",name:"serviceAccountPolicy",checked:K,onChange:e=>{O(e.target.checked)},label:"Restrict beyond user policy",description:"You can specify an optional JSON-formatted IAM policy to further restrict Access Key access to a subset of the actions and resources explicitly allowed for the parent user. Additional access beyond that of the parent user cannot be implemented through these policies."}),K&&(0,y.jsxs)(a.xA9,{item:!0,xs:12,children:[(0,y.jsx)(a.azJ,{children:(0,y.jsx)(a.V7x,{content:(0,y.jsx)(r.Fragment,{children:(0,y.jsx)("a",{target:"blank",href:"https://min.io/docs/minio/kubernetes/upstream/administration/identity-access-management/policy-based-access-control.html#policy-document-structure",children:"Guide to access policy structure"})}),placement:"right",children:(0,y.jsx)(m.A,{children:"Current User Policy - edit the JSON to remove permissions for this Access Key"})})}),(0,y.jsx)(a.xA9,{item:!0,xs:12,sx:{...s.Uz.formScrollable},children:(0,y.jsx)(u.A,{value:T,onChange:e=>{D(e)},editorHeight:"350px"})})]}),(0,y.jsx)(a.xA9,{xs:12,sx:{display:"flex",alignItems:"center",justifyContent:"start",fontWeight:600,color:"rgb(7, 25, 62)",gap:2,marginBottom:"15px",marginTop:"15px"},children:(0,y.jsx)(a.azJ,{sx:{marginTop:"15px",width:"100%","& label":{width:"180px"}},children:(0,y.jsx)(a.e8j,{noLabelMinWidth:!0,value:N,onChange:e=>{I(e)},id:"expiryTime",label:"Expiry",timeFormat:"24h",secondsSelector:!1})})}),(0,y.jsx)(a.cl_,{value:J,label:"Name",id:"name",name:"name",type:"text",placeholder:"Enter a name",onChange:e=>{k(e.target.value)}}),(0,y.jsx)(a.cl_,{value:z,label:"Description",id:"description",name:"description",type:"text",placeholder:"Enter a description",onChange:e=>{R(e.target.value)}}),(0,y.jsx)(a.cl_,{value:_,label:"Comments",id:"comment",name:"comment",type:"text",placeholder:"Enter a comment",onChange:e=>{B(e.target.value)}}),(0,y.jsxs)(a.xA9,{item:!0,xs:12,sx:{...s.Uz.modalButtonBar},children:[(0,y.jsx)(a.$nd,{id:"clear",type:"button",variant:"regular",onClick:()=>{D(""),P(null),C(""),S("")},label:"Clear"}),(0,y.jsx)(a.$nd,{id:"create-sa",type:"submit",variant:"callAction",color:"primary",label:"Create"})]})]})})})]})]})}},78619:(e,t,n)=>{"use strict";n.d(t,{A:()=>b});var r=n(65043),o=n(33097),a=n.n(o),s=n(94574),i=n(89923),c=n(94141),l=n(61476),d=n.n(l),p=n(64159),u=n(20554),y=n(70579);const f=e=>{let{label:t="",value:n=""}=e;const r=(0,u.jL)();return(0,y.jsxs)(i.azJ,{sx:{marginTop:12},children:[(0,y.jsx)(i.l1Y,{children:t}),(0,y.jsx)(i.EmB,{actionButton:(0,y.jsx)(d(),{text:n,children:(0,y.jsx)(i.$nd,{id:"copy-path",variant:"regular",onClick:()=>{r((0,p.h0)("".concat(t," copied to clipboard")))},style:{marginRight:"5px",width:"28px",height:"28px",padding:"0px"},icon:(0,y.jsx)(i.TdU,{})})}),children:n})]})};var h=n(6681),x=n(77403);const m=s.Ay.div((e=>{let{theme:t}=e;return{color:a()(t,"signalColors.danger","#C51B3F"),fontSize:".85rem",margin:".5rem 0 .5rem 0",display:"flex",alignItems:"center","& svg ":{marginRight:".3rem",height:16,width:16}}})),g=(e,t)=>{let n=document.createElement("a");n.setAttribute("href","data:text/plain;charset=utf-8,"+t),n.setAttribute("download",e),n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n)},b=e=>{let{newServiceAccount:t,open:n,closeModal:o,entity:s}=e;if(!t)return null;const l=a()(t,"console",null),d=a()(t,"idp",!1);return(0,y.jsx)(c.A,{modalOpen:n,onClose:()=>{o()},title:"New ".concat(s," Created"),titleIcon:(0,y.jsx)(i.kQt,{}),children:(0,y.jsxs)(i.xA9,{container:!0,children:[(0,y.jsxs)(i.xA9,{item:!0,xs:12,children:["A new ",s," has been created with the following details:",!d&&l&&(0,y.jsx)(r.Fragment,{children:(0,y.jsxs)(i.xA9,{item:!0,xs:12,sx:{overflowY:"auto",maxHeight:350},children:[(0,y.jsx)(i.azJ,{sx:{padding:".8rem 0 0 0",fontWeight:600,fontSize:".9rem"},children:"Console Credentials"}),Array.isArray(l)&&l.map(((e,t)=>(0,y.jsxs)(r.Fragment,{children:[(0,y.jsx)(f,{label:"Access Key",value:e.accessKey}),(0,y.jsx)(f,{label:"Secret Key",value:e.secretKey})]}))),!Array.isArray(l)&&(0,y.jsxs)(r.Fragment,{children:[(0,y.jsx)(f,{label:"Access Key",value:l.accessKey}),(0,y.jsx)(f,{label:"Secret Key",value:l.secretKey})]})]})}),(null===l||void 0===l)&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(f,{label:"Access Key",value:t.accessKey||""}),(0,y.jsx)(f,{label:"Secret Key",value:t.secretKey||""})]}),d?(0,y.jsx)(m,{children:"Please Login via the configured external identity provider."}):(0,y.jsxs)(m,{children:[(0,y.jsx)(i.cJw,{}),(0,y.jsx)("span",{children:"Write these down, as this is the only time the secret will be displayed."})]})]}),(0,y.jsx)(i.xA9,{item:!0,xs:12,sx:{...x.Uz.modalButtonBar},children:!d&&(0,y.jsxs)(r.Fragment,{children:[(0,y.jsx)(h.A,{tooltip:"Download credentials in a JSON file formatted for import using mc alias import. This will only include the default login credentials.",children:(0,y.jsx)(i.$nd,{id:"download-button",label:"Download for import",onClick:()=>{let e={};if(l)if(Array.isArray(l)){e=l.map((e=>({url:e.url,accessKey:e.accessKey,secretKey:e.secretKey,api:"s3v4",path:"auto"})))[0]}else e={url:l.url,accessKey:l.accessKey,secretKey:l.secretKey,api:"s3v4",path:"auto"};else e={url:t.url,accessKey:t.accessKey,secretKey:t.secretKey,api:"s3v4",path:"auto"};g("credentials.json",JSON.stringify({...e}))},icon:(0,y.jsx)(i.s3U,{}),variant:"callAction"})}),Array.isArray(l)&&l.length>1&&(0,y.jsx)(h.A,{tooltip:"Download all access credentials to a JSON file. NOTE: This file is not formatted for import using mc alias import. If you plan to import this alias from the file, please use the Download for Import button. ",children:(0,y.jsx)(i.$nd,{id:"download-all-button",label:"Download all access credentials",onClick:()=>{let e={};if(l&&Array.isArray(l)&&l.length>1){e=l.map((e=>({accessKey:e.accessKey,secretKey:e.secretKey})))}g("all_credentials.json",JSON.stringify({...e}))},icon:(0,y.jsx)(i.s3U,{}),variant:"callAction",color:"primary"})})]})})]})})}},41206:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(65043),o=n(89923),a=n(61476),s=n.n(a),i=n(6681),c=n(70579);const l=e=>{let{value:t,label:n="",tooltip:a="",mode:l="json",onChange:d,editorHeight:p=250,helptip:u}=e;return(0,c.jsx)(o.BYM,{value:t,onChange:e=>d(e),mode:l,tooltip:a,editorHeight:p,label:n,helpTools:(0,c.jsx)(r.Fragment,{children:(0,c.jsx)(i.A,{tooltip:"Copy to Clipboard",children:(0,c.jsx)(s(),{text:t,children:(0,c.jsx)(o.$nd,{type:"button",id:"copy-code-mirror",icon:(0,c.jsx)(o.TdU,{}),color:"primary",variant:"regular"})})})}),helpTip:u,helpTipPlacement:"right"})}},11441:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});n(65043);var r=n(94574),o=n(70579);const a=r.Ay.h1((()=>({padding:0,margin:0,fontSize:".9rem"}))),s=e=>{let{children:t}=e;return(0,o.jsx)(a,{children:t})}},75270:(e,t,n)=>{"use strict";var r=n(40139),o={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var n,a,s,i,c,l,d=!1;t||(t={}),n=t.debug||!1;try{if(s=r(),i=document.createRange(),c=document.getSelection(),(l=document.createElement("span")).textContent=e,l.ariaHidden="true",l.style.all="unset",l.style.position="fixed",l.style.top=0,l.style.clip="rect(0, 0, 0, 0)",l.style.whiteSpace="pre",l.style.webkitUserSelect="text",l.style.MozUserSelect="text",l.style.msUserSelect="text",l.style.userSelect="text",l.addEventListener("copy",(function(r){if(r.stopPropagation(),t.format)if(r.preventDefault(),"undefined"===typeof r.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var a=o[t.format]||o.default;window.clipboardData.setData(a,e)}else r.clipboardData.clearData(),r.clipboardData.setData(t.format,e);t.onCopy&&(r.preventDefault(),t.onCopy(r.clipboardData))})),document.body.appendChild(l),i.selectNodeContents(l),c.addRange(i),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");d=!0}catch(p){n&&console.error("unable to copy using execCommand: ",p),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),d=!0}catch(p){n&&console.error("unable to copy using clipboardData: ",p),n&&console.error("falling back to prompt"),a=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(a,e)}}finally{c&&("function"==typeof c.removeRange?c.removeRange(i):c.removeAllRanges()),l&&document.body.removeChild(l),s()}return d}},24480:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.CopyToClipboard=void 0;var o=i(n(65043)),a=i(n(75270)),s=["text","onCopy","options","children"];function i(e){return e&&e.__esModule?e:{default:e}}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){x(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function d(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function y(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=h(e);if(t){var a=h(this).constructor;n=Reflect.construct(o,arguments,a)}else n=o.apply(this,arguments);return function(e,t){if(t&&("object"===r(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return f(e)}(this,n)}}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function x(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var m=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}(c,e);var t,n,r,i=y(c);function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return x(f(e=i.call.apply(i,[this].concat(n))),"onClick",(function(t){var n=e.props,r=n.text,s=n.onCopy,i=n.children,c=n.options,l=o.default.Children.only(i),d=(0,a.default)(r,c);s&&s(r,d),l&&l.props&&"function"===typeof l.props.onClick&&l.props.onClick(t)})),e}return t=c,(n=[{key:"render",value:function(){var e=this.props,t=(e.text,e.onCopy,e.options,e.children),n=d(e,s),r=o.default.Children.only(t);return o.default.cloneElement(r,l(l({},n),{},{onClick:this.onClick}))}}])&&p(t.prototype,n),r&&p(t,r),Object.defineProperty(t,"prototype",{writable:!1}),c}(o.default.PureComponent);t.CopyToClipboard=m,x(m,"defaultProps",{onCopy:void 0,options:void 0})},61476:(e,t,n)=>{"use strict";var r=n(24480).CopyToClipboard;r.CopyToClipboard=r,e.exports=r},40139:e=>{e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||n.forEach((function(t){e.addRange(t)})),t&&t.focus()}}}}]);
     2  //# sourceMappingURL=6925.b3e208b0.chunk.js.map