UNPKG

@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) • 5.5 kB
import{a as j,l as U}from"./chunk-K4OFWFQE.js";import"./chunk-IKK5DQ3Z.js";import"./chunk-LEEL6MDA.js";import"./chunk-HUXCPIDO.js";import"./chunk-XPF5YBGU.js";import"./chunk-XUEIITMC.js";import"./chunk-Z2HQA5DO.js";import"./chunk-2DD7CZB4.js";import"./chunk-J7PZFXOE.js";import"./chunk-SYLZLLGS.js";import{a as Y}from"./chunk-IVXFG5AJ.js";import{a as B,b as L}from"./chunk-2SO4BVIT.js";import"./chunk-2BNLISUN.js";import{a as w,b as V,e as I,i as D,j as k,k as A,n as O,o as P,p as X}from"./chunk-T5HLFYHP.js";import{c as F}from"./chunk-KCJ5HNXP.js";import{a as N}from"./chunk-7A4HO4AV.js";import"./chunk-ZRDXKVPG.js";import{Aa as r,Ba as a,I as C,Ja as R,K as x,L as g,La as f,Na as s,R as _,Wa as E,Xa as n,Ya as d,Za as T,_ as i,ga as y,sb as v,ta as u,tb as b,ua as m,wa as S,xa as q,ya as M,za as p}from"./chunk-FYA6QUPZ.js";import"./chunk-WFIHWVQO.js";function H(t,o){if(t&1&&(n(0," Your access to "),r(1,"strong"),n(2),a(),n(3," has expired. This asks the admins to grant it again. ")),t&2){let e=s(2);i(2),d(e.resource().name)}}function z(t,o){if(t&1&&(n(0," Your access to "),r(1,"strong"),n(2),a(),n(3," is ending soon. This asks the admins for more time \u2014 an approval replaces the current end date. ")),t&2){let e=s(2);i(2),d(e.resource().name)}}function G(t,o){if(t&1&&(r(0,"div",1),u(1,H,4,1)(2,z,4,1),a()),t&2){let e=o;E(e.expired?"bg-danger-muted text-danger ring-danger/20":"bg-warning-muted text-warning ring-warning/30"),i(),m(e.expired?1:2)}}function J(t,o){if(t&1&&(n(0," for "),r(1,"strong"),n(2),a()),t&2){let e=s(2);i(2),d(e.label(e.duration()))}}function K(t,o){if(t&1){let e=R();r(0,"div",2)(1,"span"),n(2,"\u2713"),a(),r(3,"span"),n(4," Your request for "),r(5,"strong"),n(6),a(),u(7,J,3,1),n(8," is with the admins. You'll see the decision in the activity bell, and the resource appears here once it's approved. "),a()(),r(9,"div",3)(10,"app-button",4),f("click",function(){x(e);let l=s();return g(l.closed.emit())}),n(11,"Done"),a()()}if(t&2){let e=s();i(6),d(e.resource().name),i(),m(e.duration()!=="long"?7:-1)}}function Q(t,o){if(t&1&&(r(0,"span",8),n(1),a()),t&2){let e=s(2);i(),T(" \xB7 ",e.resource().accountName)}}function W(t,o){if(t&1&&(r(0,"p",9),n(1),a()),t&2){let e=s(2);i(),d(e.resource().description)}}function Z(t,o){if(t&1&&(r(0,"option",12),n(1),a()),t&2){let e=o.$implicit,c=s(2);p("ngValue",e),i(),d(c.label(e))}}function ee(t,o){if(t&1){let e=R();r(0,"div",5)(1,"div",6)(2,"span",7),n(3),a(),u(4,Q,2,1,"span",8),u(5,W,2,1,"p",9),a(),r(6,"app-field",10)(7,"select",11),f("ngModelChange",function(l){x(e);let h=s();return g(h.duration.set(l))}),q(8,Z,2,2,"option",12,S),r(10,"option",12),n(11,"Long-term (indefinite)"),a()()(),r(12,"app-field",13)(13,"textarea",14),f("ngModelChange",function(l){x(e);let h=s();return g(h.reason.set(l))}),a()()(),r(14,"div",15)(15,"app-button",16),f("click",function(){x(e);let l=s();return g(l.closed.emit())}),n(16,"Cancel"),a(),r(17,"app-button",17),f("click",function(){x(e);let l=s();return g(l.submit())}),n(18,"Send request"),a()()}if(t&2){let e=s();i(3),d(e.resource().name),i(),m(e.resource().accountName?4:-1),i(),m(e.resource().description?5:-1),i(2),p("ngModel",e.duration()),i(),M(e.PRESETS),i(2),p("ngValue","long"),i(2),p("error",e.error()),i(),p("maxlength",e.REASON_MAX)("ngModel",e.reason()),i(4),p("loading",e.busy())}}var $=class t{api=C(j);toast=C(F);notifications=C(U);resource=b.required();extension=b(null);created=v();closed=v();REASON_MAX=500;PRESETS=B;label(o){return o==="long"?"long-term":L(o)}duration=_("long");reason=_("");busy=_(!1);error=_("");sent=_(!1);ngOnInit(){this.extension()&&this.duration.set(24)}submit(){this.error.set(""),this.busy.set(!0);let o=this.duration();this.api.createResourceRequest(this.resource().resourceId,this.reason().trim()||void 0,o==="long"?void 0:o).subscribe({next:()=>{this.busy.set(!1),this.sent.set(!0),this.toast.success(`Requested ${this.resource().name}`),this.notifications.load(),this.created.emit()},error:e=>{this.busy.set(!1),this.error.set(X(e,"Could not send the request."))}})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=y({type:t,selectors:[["app-request-resource-form"]],inputs:{resource:[1,"resource"],extension:[1,"extension"]},outputs:{created:"created",closed:"closed"},decls:3,vars:2,consts:[[1,"mb-4","rounded-lg","p-3","text-sm","ring-1",3,"class"],[1,"mb-4","rounded-lg","p-3","text-sm","ring-1"],[1,"flex","items-start","gap-2","rounded-lg","bg-success-muted","p-3","text-sm","text-success","ring-1","ring-success/30"],[1,"mt-5","flex","justify-end"],[3,"click"],[1,"space-y-4"],[1,"rounded-lg","bg-muted","p-3","text-sm","text-muted-foreground","ring-1","ring-border"],[1,"font-medium","text-surface-foreground"],[1,"text-placeholder"],[1,"mt-1","text-xs","text-muted-foreground"],["label","Access duration","hint","temporary access expires on its own; the admin has the final say"],[1,"ui-input",3,"ngModelChange","ngModel"],[3,"ngValue"],["label","Reason","hint","optional, but it's what the admin decides on",3,"error"],["rows","3","placeholder","e.g. Need to query the staging database for the migration.",1,"ui-input",3,"ngModelChange","maxlength","ngModel"],[1,"mt-5","flex","justify-end","gap-2"],["variant","outline",3,"click"],[3,"click","loading"]],template:function(e,c){if(e&1&&(u(0,G,3,3,"div",0),u(1,K,12,2)(2,ee,19,9)),e&2){let l;m((l=!c.sent()&&c.extension())?0:-1,l),i(),m(c.sent()?1:2)}},dependencies:[P,k,A,w,D,V,O,I,N,Y],encapsulation:2})};export{$ as RequestResourceFormComponent};