@fntio/infra-client
Version:
Self-hosted AWS access portal: credential vending, target-account trust, and grant-driven private networking as CDK stacks and constructs.
2 lines (1 loc) • 13 kB
JavaScript
import{a as V}from"./chunk-64ITJKG6.js";import{e as A}from"./chunk-JNANYFF2.js";import{a as L}from"./chunk-XOFD5DNL.js";import{a as M}from"./chunk-PU4UT4HF.js";import{a as P}from"./chunk-Y2PHG5VS.js";import{b as D}from"./chunk-MID2IYAR.js";import{a as N}from"./chunk-7A4HO4AV.js";import{Aa as a,Ba as i,Ca as _,Ja as b,K as x,L as C,La as g,Na as r,R as S,Ua as k,Va as I,X as T,Xa as d,Ya as f,Za as h,_ as n,ga as E,qb as R,sa as y,sb as v,ta as s,tb as c,ua as m,za as u}from"./chunk-FYA6QUPZ.js";function W(t,o){if(t&1&&(a(0,"app-chip",8),d(1),i()),t&2){let e=r(3);n(),f(e.typeLabel())}}function j(t,o){if(t&1&&(a(0,"app-chip",9),d(1),i()),t&2){let e=r(3);y("title",e.grantTitle()||null),n(),f(e.grant())}}function $(t,o){if(t&1&&(a(0,"app-chip",10),_(1,"app-icon",11),d(2),i()),t&2){let e=r(3);n(),u("strokeWidth",2),n(),h("",e.creds()," ")}}function O(t,o){if(t&1&&(a(0,"div",7),s(1,W,2,1,"app-chip",8),s(2,j,2,2,"app-chip",9),s(3,$,3,2,"app-chip",10),i()),t&2){let e=r(2);n(),m(e.typeLabel()?1:-1),n(),m(e.grant()?2:-1),n(),m(e.creds()?3:-1)}}function z(t,o){if(t&1){let e=b();a(0,"div",1)(1,"span",2),_(2,"app-icon",3),i(),a(3,"button",4),g("click",function(){x(e);let l=r();return C(l.more.emit())}),_(4,"app-icon",5),i()(),a(5,"div",6),d(6),i(),s(7,O,4,3,"div",7)}if(t&2){let e=r();n(2),u("name",e.resolvedIcon()),n(2),u("strokeWidth",2),n(2),h(" ",e.account()," "),n(),m(e.typeLabel()||e.grant()||e.creds()?7:-1)}}function K(t,o){if(t&1&&(a(0,"app-chip",8),d(1),i()),t&2){let e=r(3);n(),f(e.typeLabel())}}function F(t,o){if(t&1&&(a(0,"app-chip",9),d(1),i()),t&2){let e=r(3);y("title",e.grantTitle()||null),n(),f(e.grant())}}function G(t,o){if(t&1&&(a(0,"app-chip",10),_(1,"app-icon",11),d(2),i()),t&2){let e=r(3);n(),u("strokeWidth",2),n(),h("",e.creds()," ")}}function Y(t,o){if(t&1&&(a(0,"div",16),s(1,K,2,1,"app-chip",8),s(2,F,2,2,"app-chip",9),s(3,G,3,2,"app-chip",10),i()),t&2){let e=r(2);n(),m(e.typeLabel()?1:-1),n(),m(e.grant()?2:-1),n(),m(e.creds()?3:-1)}}function q(t,o){if(t&1&&(a(0,"div",0)(1,"span",12),_(2,"app-icon",13),i(),a(3,"div",14)(4,"div",15),d(5),i(),s(6,Y,4,3,"div",16),i()()),t&2){let e=r();n(2),u("name",e.resolvedIcon()),n(3),h(" ",e.account()," "),n(),m(e.typeLabel()||e.grant()||e.creds()?6:-1)}}function H(t,o){t&1&&_(0,"app-copy-button",23),t&2&&u("text",o)}function J(t,o){if(t&1&&(a(0,"p",24),d(1),i()),t&2){let e=r(2);n(),f(e.description())}}function Q(t,o){t&1&&(a(0,"a",27),_(1,"app-icon",28),d(2," Open in browser "),i()),t&2&&u("href",o,T)}function X(t,o){if(t&1){let e=b();a(0,"div",17)(1,"div",18)(2,"span",19),d(3,"Account"),i(),a(4,"span",20),d(5),i(),a(6,"span",19),d(7,"ID"),i(),a(8,"span",21)(9,"span",22),d(10),i(),s(11,H,1,1,"app-copy-button",23),i()(),s(12,J,2,1,"p",24),i(),a(13,"div",25)(14,"button",26),g("click",function(){x(e);let l=r();return C(l.connectionDetails.emit())}),d(15," Connection details "),i(),s(16,Q,3,1,"a",27),i()}if(t&2){let e,p,l=r();n(),k("grid-template-columns","76px minmax(0,1fr)"),n(4),f(l.accountName()),n(5),f(l.accountId()),n(),m((e=l.rawAccountId())?11:-1,e),n(),m(l.description()?12:-1),n(2),I("border-r",l.connectionUrl())("border-border",l.connectionUrl()),n(2),m((p=l.connectionUrl())?16:-1,p)}}function Z(t,o){if(t&1&&(a(0,"span",19),d(1,"Role"),i(),a(2,"span",34),d(3),i()),t&2){let e=r(2);n(3),f(e.role())}}function ee(t,o){if(t&1){let e=b();a(0,"input",36),g("keydown.enter",function(l){x(e);let w=r(3);return C(w.commitProfile(l.target.value))})("keydown.escape",function(){x(e);let l=r(3);return C(l.editingProfile.set(!1))})("blur",function(l){x(e);let w=r(3);return C(w.editingProfile()&&w.commitProfile(l.target.value))}),i()}if(t&2){let e=r(3);u("value",e.profile()),y("aria-label","Rename the CLI profile for "+e.role())}}function te(t,o){if(t&1){let e=b();a(0,"button",42),g("click",function(){x(e);let l=r(5);return C(l.profileReset.emit())}),d(1," \u21BA "),i()}if(t&2){let e=r(5);u("title","Reset to the suggested name: "+e.profileSuggested()),y("aria-label","Reset the CLI profile for "+e.role()+" to "+e.profileSuggested())}}function ne(t,o){if(t&1){let e=b();a(0,"app-button",39),g("click",function(){x(e);let l=r(4);return C(l.editingProfile.set(!0))}),_(1,"app-icon",40),i(),s(2,te,2,2,"button",41)}if(t&2){let e=r(4);u("ariaLabel","Rename the CLI profile for "+e.role()),n(),u("strokeWidth",2),n(),m(e.profileSource()==="override"?2:-1)}}function ie(t,o){if(t&1&&(a(0,"span",37),d(1),i(),s(2,ne,3,3),_(3,"app-copy-button",38)),t&2){let e=r(3);u("title",e.profileTitle()),n(),f(e.profile()),n(),m(e.profileEditable()?2:-1),n(),u("text",e.profile())}}function oe(t,o){if(t&1&&(a(0,"span",19),d(1,"Profile"),i(),a(2,"span",21),s(3,ee,1,2,"input",35)(4,ie,4,4),i()),t&2){let e=r(2);n(3),m(e.editingProfile()?3:4)}}function ae(t,o){t&1&&_(0,"app-copy-button",23),t&2&&u("text",o)}function re(t,o){if(t&1){let e=b();a(0,"div",30)(1,"span",43),_(2,"app-icon",44),d(3," Auto-login on sign-in "),i(),a(4,"app-toggle",45),g("checkedChange",function(){x(e);let l=r(2);return C(l.autoLoginToggle.emit())}),i()()}if(t&2){let e=r(2);n(4),u("checked",e.autoLogin())("ariaLabel","Auto-login on sign-in for "+e.role())("title",e.autoLogin()?"On \u2014 credentials are vended for this role and written to ~/.aws/credentials when you open the app. Click to turn off.":"Off \u2014 click to vend and write this role's credentials automatically when you open the app.")}}function le(t,o){t&1&&_(0,"app-spinner",32)}function de(t,o){t&1&&_(0,"app-icon",28)}function ce(t,o){if(t&1){let e=b();a(0,"div",29),s(1,Z,4,1),s(2,oe,5,1),a(3,"span",19),d(4,"Account ID"),i(),a(5,"span",21)(6,"span",22),d(7),i(),s(8,ae,1,1,"app-copy-button",23),i()(),s(9,re,5,3,"div",30),a(10,"div",25)(11,"button",31),g("click",function(){x(e);let l=r();return C(l.console.emit())}),s(12,le,1,0,"app-spinner",32)(13,de,1,0,"app-icon",28),d(14," Console "),i(),a(15,"button",33),g("click",function(){x(e);let l=r();return C(l.getCredentials.emit())}),d(16," Get credentials "),i()()}if(t&2){let e,p=r();k("grid-template-columns","76px minmax(0,1fr)"),n(),m(p.showRoleRow()?1:-1),n(),m(p.profile()?2:-1),n(5),f(p.id()),n(),m((e=p.rawId())?8:-1,e),n(),m(p.autoLogin()!==null?9:-1),n(2),u("disabled",p.consoleBusy()),y("aria-busy",p.consoleBusy()||null),n(),m(p.consoleBusy()?12:13)}}var B={prod:"env-prod",staging:"env-staging",dev:"env-dev",sandbox:"env-sandbox"},U=class t{kind=c("role");env=c();icon=c();account=c("");role=c("");showRoleRow=c(!0);profileSource=c("default");profileSuggested=c("");profileReset=v();profileTitle=R(()=>{let o="CLI profile name \u2014 exactly what is written to ~/.aws/credentials";switch(this.profileSource()){case"override":return`${o}. Your own name (suggested: ${this.profileSuggested()})`;case"account":return`${o}. Set by an admin for this account`;case"role":return`${o}. Set by an admin for this role`;default:return`${o}. Default: <account>-<role>`}});id=c("");grant=c("");grantTitle=c("");creds=c("");typeLabel=c("");variant=c("stacked");rawId=c();autoLogin=c(null);consoleBusy=c(!1);profileEditable=c(!1);profile=c("");accountName=c("");accountId=c("");rawAccountId=c();description=c("");connectionUrl=c();getCredentials=v();console=v();autoLoginToggle=v();more=v();profileRename=v();connectionDetails=v();editingProfile=S(!1);headerVariant=R(()=>this.kind()==="resource"?"inline":this.variant());resolvedIcon=R(()=>{let o=this.icon();if(o)return o;let e=this.env();return e?B[e]:B.prod});commitProfile(o){if(!this.editingProfile())return;this.editingProfile.set(!1);let e=o.trim();e!==this.profile()&&this.profileRename.emit(e)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=E({type:t,selectors:[["app-role-card"]],hostAttrs:[1,"flex","flex-col","overflow-hidden","rounded-2xl","border","border-border/70","bg-card-bg"],inputs:{kind:[1,"kind"],env:[1,"env"],icon:[1,"icon"],account:[1,"account"],role:[1,"role"],showRoleRow:[1,"showRoleRow"],profileSource:[1,"profileSource"],profileSuggested:[1,"profileSuggested"],id:[1,"id"],grant:[1,"grant"],grantTitle:[1,"grantTitle"],creds:[1,"creds"],typeLabel:[1,"typeLabel"],variant:[1,"variant"],rawId:[1,"rawId"],autoLogin:[1,"autoLogin"],consoleBusy:[1,"consoleBusy"],profileEditable:[1,"profileEditable"],profile:[1,"profile"],accountName:[1,"accountName"],accountId:[1,"accountId"],rawAccountId:[1,"rawAccountId"],description:[1,"description"],connectionUrl:[1,"connectionUrl"]},outputs:{profileReset:"profileReset",getCredentials:"getCredentials",console:"console",autoLoginToggle:"autoLoginToggle",more:"more",profileRename:"profileRename",connectionDetails:"connectionDetails"},decls:4,vars:2,consts:[[1,"flex","items-center","gap-4","px-5","pt-4"],[1,"flex","items-start","justify-between","px-5","pt-4"],[1,"grid","h-8","w-8","shrink-0","place-items-center","rounded-lg","bg-muted","text-muted-foreground"],[1,"h-[18px]","w-[18px]",3,"name"],["type","button","aria-label","More options",1,"grid","h-7","w-7","place-items-center","rounded-md","text-muted-foreground","transition-colors","hover:bg-muted","hover:text-surface-foreground",3,"click"],["name","ellipsis",1,"h-4","w-4",3,"strokeWidth"],[1,"mt-1.5","min-w-0","truncate","px-5","text-base","font-semibold","tracking-[-0.01em]","text-surface-foreground"],[1,"mt-1.5","flex","items-center","gap-2","px-5"],["tone","neutral"],["tone","warning"],["tone","success",1,"tabular-nums"],["name","clock",1,"h-3","w-3",3,"strokeWidth"],[1,"grid","h-11","w-11","shrink-0","place-items-center","rounded-lg","bg-muted","text-muted-foreground"],[1,"h-5","w-5",3,"name"],[1,"min-w-0","flex-1"],[1,"truncate","text-base","font-semibold","tracking-[-0.01em]","text-surface-foreground"],[1,"mt-px","flex","items-center","gap-2"],[1,"px-5","py-4"],[1,"grid","items-baseline","gap-y-[7px]"],[1,"text-[12.5px]","text-text-secondary"],[1,"truncate","text-[13.5px]","font-medium","text-surface-foreground"],[1,"flex","min-w-0","items-center","gap-1"],[1,"truncate","font-mono","text-[13.5px]","tabular-nums","text-muted-foreground"],["variant","icon","label","Copy account ID",3,"text"],[1,"mt-2.5","whitespace-pre-line","text-xs","text-muted-foreground"],[1,"flex","border-t","border-border"],["type","button",1,"inline-flex","flex-1","items-center","justify-center","gap-1.5","px-2.5","py-3","text-[12.5px]","text-muted-foreground","transition-colors","hover:bg-muted",3,"click"],["target","_blank","rel","noopener",1,"inline-flex","flex-1","items-center","justify-center","gap-1.5","px-2.5","py-3","text-[12.5px]","text-brand-text","transition-colors","hover:bg-brand/12",3,"href"],["name","external-link",1,"h-[15px]","w-[15px]"],[1,"mt-auto","grid","items-baseline","gap-y-[7px]","px-5","pt-6","pb-6"],[1,"flex","items-center","justify-between","border-t","border-border","px-5","py-2.5"],["type","button",1,"inline-flex","flex-1","items-center","justify-center","gap-1.5","border-r","border-border","px-2.5","py-3","text-[12.5px]","text-muted-foreground","transition-colors","hover:bg-muted","disabled:cursor-progress","disabled:hover:bg-transparent",3,"click","disabled"],["sizeClass","h-[15px] w-[15px]"],["type","button",1,"inline-flex","flex-1","items-center","justify-center","gap-1.5","px-2.5","py-3","text-[12.5px]","text-brand-text","transition-colors","hover:bg-brand/12",3,"click"],[1,"truncate","text-[13.5px]","font-semibold","text-surface-foreground"],["appAutofocusSelect","",1,"w-full","min-w-0","rounded-md","border","border-border-strong","bg-surface","px-1.5","py-0.5","font-mono","text-[13.5px]","text-surface-foreground","focus:outline-none",3,"value"],["appAutofocusSelect","",1,"w-full","min-w-0","rounded-md","border","border-border-strong","bg-surface","px-1.5","py-0.5","font-mono","text-[13.5px]","text-surface-foreground","focus:outline-none",3,"keydown.enter","keydown.escape","blur","value"],[1,"truncate","font-mono","text-[13.5px]","text-muted-foreground",3,"title"],["variant","icon","label","Copy profile name",3,"text"],["variant","ghost","size","icon-sm","title","Rename this profile \u2014 clear the field to go back to the default",1,"shrink-0",3,"click","ariaLabel"],["name","pencil",1,"h-3","w-3",3,"strokeWidth"],["type","button",1,"grid","h-5","shrink-0","place-items-center","rounded-md","px-1","text-[11px]","leading-none","text-muted-foreground","opacity-60","transition-colors","hover:bg-muted","hover:text-surface-foreground","hover:opacity-100",3,"title"],["type","button",1,"grid","h-5","shrink-0","place-items-center","rounded-md","px-1","text-[11px]","leading-none","text-muted-foreground","opacity-60","transition-colors","hover:bg-muted","hover:text-surface-foreground","hover:opacity-100",3,"click","title"],[1,"flex","items-center","gap-1.5","text-[12.5px]","text-muted-foreground"],["name","bolt",1,"h-[15px]","w-[15px]"],[3,"checkedChange","checked","ariaLabel","title"]],template:function(e,p){e&1&&(s(0,z,8,4)(1,q,7,3,"div",0),s(2,X,17,11)(3,ce,17,10)),e&2&&(m(p.headerVariant()==="stacked"?0:1),n(2),m(p.kind()==="resource"?2:3))},dependencies:[D,N,A,P,V,L,M],encapsulation:2})};export{U as a};