1import{m as de,n as T,o as ue,t as fe}from"./chunk-XUIPHH6G.js";import{a as oe,c as w}from"./chunk-B7CJFDRK.js";import{b as re}from"./chunk-6C4ITI77.js";import{b as v,va as ae}from"./chunk-P6MTM5JK.js";import"./chunk-HFPFZ46Q.js";import"./chunk-ERIDXJVM.js";import{a as ie}from"./chunk-IJNNQGWW.js";import{Ma as me,_ as pe,g as X,i as V,ua as le}from"./chunk-FIW55SPL.js";import{a as se,b as ce}from"./chunk-72PQ3OJI.js";import{$,$b as J,Sa as M,Tb as H,Ub as W,Va as z,Vb as G,Xc as ne,Yb as Y,_b as q,ac as I,bc as Q,cc as U,uc as Z,vc as ee,yc as te}from"./chunk-MFVRKY3Y.js";import{Cb as C,I as S,Kc as _,Ma as j,Mb as R,Na as o,Qb as a,Rb as P,Sb as A,Ua as l,Wc as O,Ya as h,Za as k,Zb as K,_b as L,ab as f,cc as d,gd as F,id as N,jc as E,ld as B,mb as s,nb as i,ob as n,pb as c,tb as x,ub as g}from"./chunk-E6QGSO2A.js";import"./chunk-QBUHZOWM.js";var y=()=>["bash"];function Me(t,u){t&1&&(i(0,"insta-notification-box",12)(1,"p")(2,"strong"),a(3,"Please note:"),n(),a(4," Instaclustr does not currently support using the Karapace REST Proxy with a specific role."),n(),i(5,"p"),a(6,"Clients using the Karapace REST Proxy have the ability to produce and consume from any topic in the Kafka Cluster regardless of ACLs set on the topic."),n(),i(7,"p"),a(8,"If you have any questions about this, please contact support at "),i(9,"a",13),a(10,"[email protected]"),n(),a(11,"."),n()())}function Ie(t,u){if(t&1&&(x(0),i(1,"div",6)(2,"div",7),a(3,"Username:"),n(),i(4,"div",8)(5,"code"),a(6),n(),c(7,"insta-copy",14),n()(),i(8,"div",6)(9,"div",7),a(10,"Password:"),n(),i(11,"div",8)(12,"code"),a(13),n(),c(14,"insta-copy",14),i(15,"p",10),a(16,"Karapace REST Proxy API is secured with basic authentication."),n()()(),g()),t&2){let e=C(2);o(6),P(e.karapaceRestProxyUsername),o(),s("copy",K(e.karapaceRestProxyUsername)),o(6),P(e.runningDataCentre==null?null:e.runningDataCentre.karapaceRestProxyPassword),o(),s("copy",K(e.runningDataCentre==null?null:e.runningDataCentre.karapaceRestProxyPassword))}}function Ue(t,u){t&1&&(x(0),i(1,"p"),a(2,"Note: You can use a port in the range of 8091-8093"),n(),g())}function we(t,u){if(t&1&&(x(0),i(1,"h2"),a(2,"Karapace REST Proxy Connection Info"),n(),i(3,"mat-card")(4,"mat-card-header")(5,"div",2)(6,"mat-icon"),a(7,"lock"),n()(),i(8,"mat-card-title"),a(9,"Credentials and Connection Information"),n()(),i(10,"mat-card-content"),f(11,Me,12,0,"insta-notification-box",3),i(12,"div",4),f(13,Ie,17,6,"ng-container",5),i(14,"div",6)(15,"div",7),a(16,"Port:"),n(),i(17,"div",8)(18,"code"),a(19,"8083"),n()()(),i(20,"div",6)(21,"div",7),a(22,"URL:"),n(),i(23,"div",8)(24,"a",9),a(25),n(),i(26,"p",10),a(27," URL with an associated CA signed certificate "),n()()(),i(28,"strong"),a(29,"Example"),n(),c(30,"insta-code-block",11),n()()(),c(31,"mat-divider"),i(32,"h4"),a(33,"Examples"),n(),f(34,Ue,3,0,"ng-container",5),i(35,"p"),a(36,"List brokers:"),n(),c(37,"insta-code-block",11),i(38,"p"),a(39,"List topics:"),n(),c(40,"insta-code-block",11),i(41,"p"),a(42,"Create consumer: "),c(43,"br"),n(),c(44,"insta-code-block",11),i(45,"p"),a(46,"Subscribe consumer to topic:"),n(),c(47,"insta-code-block",11),i(48,"p"),a(49,"Produce to topic:"),n(),c(50,"insta-code-block",11),i(51,"p"),a(52,"Consume from topic:"),n(),c(53,"insta-code-block",11),g()),t&2){let e=C();o(11),s("ngIf",!e.restProxyUserExists),o(2),s("ngIf",e.runningDataCentre==null?null:e.runningDataCentre.karapaceRestProxyPassword),o(11),s("href",L("https://",e.karapaceRestProxyDomain,":8083"),j),o(),A("https://",e.karapaceRestProxyDomain,":8083"),o(5),s("code","curl -XGET https://"+e.karapaceRestProxyDomain+":8083/topics -u ickarapacerest:"+(e.runningDataCentre==null?null:e.runningDataCentre.karapaceRestProxyPassword))("languages",d(20,y)),o(4),s("ngIf",e.kafkaCdc==null?null:e.kafkaCdc.privateLink),o(3),s("code","curl "+e.karapaceRestProxyExampleUrl+"/brokers")("languages",d(21,y)),o(3),s("code","curl "+e.karapaceRestProxyExampleUrl+"/topics")("languages",d(22,y)),o(4),s("code","curl -XPOST "+e.karapaceRestProxyExampleUrl+`/consumers/consumer1 \\ 2--data '{"name": "my_consumer_instance", "format": "json", "auto.offset.reset": "earliest"}' \\ 3--header "Content-Type: application/vnd.kafka.json.v2+json"`)("languages",d(23,y)),o(3),s("code","curl -XPOST "+e.karapaceRestProxyExampleUrl+`/consumers/consumer1/instances/my_consumer_instance/subscription \\ 4--data '{"topics": ["test"]}' \\
5--header "Content-Type: application/vnd.kafka.json.v2+json"`)("languages",d(24,y)),o(3),s("code","curl -XPOST "+e.karapaceRestProxyExampleUrl+`/topics/test \\ 6--data '{"records": [{"key": "hello","value": "world"}]}' \\ 7--header "Content-Type: application/vnd.kafka.json.v2+json"`)("languages",d(25,y)),o(3),s("code","curl "+e.karapaceRestProxyExampleUrl+`/consumers/consumer1/instances/my_consumer_instance/records \\ 8--header "Accept: application/vnd.kafka.json.v2+json"`)("languages",d(26,y))}}function Te(t,u){t&1&&c(0,"mat-spinner")}var xe=(()=>{class t{constructor(e,r){this.connectionInfoService=e,this.bundleUserManagementService=r,this.subscriptions=new M,this.karapaceRestProxyUsername="ickarapacerest",this.restProxyUserExists=!0}ngOnInit(){this.subscriptions.add(this.connectionInfoService.model$.pipe($).subscribe(e=>{this.runningDataCentre=e.runningDataCentres[0],this.kafkaCdc=e.runningDataCentres[0],this.karapaceRestProxyNodeList=this.runningDataCentre.nodes.filter(r=>r.badges.some(p=>p.text===ae.BADGE_TEXT_REST_PROXY)),this.runningDataCentre.karRPPrivateLinkCnameRecord?this.karapaceRestProxyDomain=this.runningDataCentre.karRPPrivateLinkCnameRecord:this.karapaceRestProxyDomain=Object.values(this.runningDataCentre.karapaceRestProxyDomainMap).find(r=>r),this.kafkaCdc.privateLink?this.karapaceRestProxyExampleUrl=`-k -u ${this.karapaceRestProxyUsername}:${this.runningDataCentre?.karapaceRestProxyPassword} https://${this.karapaceRestProxyDomain}:8091`:this.karapaceRestProxyExampleUrl=`-k -u ${this.karapaceRestProxyUsername}:${this.runningDataCentre?.karapaceRestProxyPassword} https://${this.karapaceRestProxyNodeList[0].publicAddress||this.karapaceRestProxyNodeList[0].privateAddress}:8083`,this.connectionInfoModel=e}),this.bundleUserManagementService.loadBundleUserDataForCluster$(v.Kafka).pipe().subscribe(e=>{e.usernames&&(this.restProxyUserExists=e.usernames.includes("ic_addon_rest_proxy"))}))}ngOnDestroy(){this.subscriptions.destroyAll()}static{this.\u0275fac=function(r){return new(r||t)(l(oe),l(T))}}static{this.\u0275cmp=h({type:t,selectors:[["insta-karapace-rest-proxy-connection-info"]],standalone:!1,decls:4,vars:2,consts:[["loading",""],[4,"ngIf","ngIfElse"],["mat-card-avatar",""],["type","warn",4,"ngIf"],[1,"description-list"],[4,"ngIf"],[1,"description-property-item"],[1,"description-label"],[1,"description-value"],["target","_blank",3,"href"],[1,"help-block"],[3,"code","languages"],["type","warn"],["href","mailto:[email protected]"],[3,"copy"]],template:function(r,p){if(r&1&&(i(0,"insta-bundle-tab-wrapper"),f(1,we,54,27,"ng-container",1)(2,Te,1,0,"ng-template",null,0,E),n()),r&2){let b=R(3);o(),s("ngIf",p.connectionInfoModel)("ngIfElse",b)}},dependencies:[_,I,te,pe,U,H,q,G,Y,W,Z,se,w],styles:[".description-list[_ngcontent-%COMP%] .description-property-item{margin-top:10px;flex-direction:row;box-sizing:border-box;display:flex}.description-list[_ngcontent-%COMP%] .description-property-item .description-label{text-align:right;padding-right:30px;color:#001050;flex:1 1 100%;box-sizing:border-box;place-content:flex-end;flex-direction:row;display:flex;width:300px;min-width:300px}.description-list[_ngcontent-%COMP%] .description-property-item .description-value{flex:1 1 0;box-sizing:border-box;width:calc(100% - 300px);min-width:calc(100% - 300px)}.description-list[_ngcontent-%COMP%] .description-property-item .single-row-overflow{white-space:nowrap;overflow-x:auto}.description-list[_ngcontent-%COMP%] .help-block{font-size:.75em;margin-top:5px}.action-block-description-section[_ngcontent-%COMP%]{padding-right:1em}.action-block-action-section[_ngcontent-%COMP%]{font-size:.75em;text-align:right}.action-block-action-section[_ngcontent-%COMP%] insta-action-button[_ngcontent-%COMP%]{font-size:1.25em;margin-bottom:5px;display:block} .mat-mdc-tab-body{margin-top:10px}"]})}}return t})();function De(t,u){if(t&1&&(x(0),i(1,"h3"),a(2,"Karapace REST Proxy User Management"),n(),c(3,"insta-bundle-user-table",3),g()),t&2){let e=C();o(3),s("bundleType",e.bundleType)("bundleUserData",e.tableUserData)("actions",e.actions)}}function Ke(t,u){if(t&1&&(x(0),i(1,"insta-notification-box",4),a(2),n(),g()),t&2){let e=C();o(2),P(e.notificationBoxMessage)}}function Be(t,u){t&1&&c(0,"mat-spinner")}var ge=(()=>{class t{constructor(e,r,p,b,Ce,ve,be,Pe){this.accountService=e,this.cluster
8sService=r,this.bundleUserManagementService=p,this.impersonationService=b,this.dialogService=Ce,this.snackBar=ve,this.router=be,this.route=Pe,this.bundleType=v.KarapaceRestProxy,this.blockForm=!1,this.editAllowed=!1,this.actions=[],this.subscriptions=new M,this.subscriptions.add(e.currentAccount$.subscribe(m=>{this.account=m,this.editAllowed=ie.EDIT_BUNDLE_USERS.appliesTo(m)&&!this.impersonationService.isImpersonating,this.actions=[{buttonName:"Change Password",showIfRowCondition:()=>this.editAllowed,action:this.navigateToChangePass.bind(this)}]}),this.clustersService.currentClusterHasChanged$.subscribe(m=>{this.cluster=m,this.tableUserData=void 0,this.bundleUserManagementService.bundleUserData.clearAndLoad(this.bundleType)}),this.bundleUserManagementService.bundleUserData.observable$.pipe().subscribe(m=>{m===void 0?this.tableUserData=void 0:m.usernames?this.tableUserData=this.mapApiResultToBundleUsers(m.usernames):m.error&&(this.notificationBoxMessage=`Error returning users (${m.error}). Please refresh the page to try again.`,this.tableUserData=[])}))}mapApiResultToBundleUsers(e){let r=[];return e.forEach(p=>{r.push({username:p})}),r}navigateToChangePass(e,r){this.tableUserData&&this.router.navigate([this.tableUserData[r].username+"/password"],{relativeTo:this.route})}ngOnInit(){this.bundleUserManagementService.bundleUserData.loadNextIfUndefined(this.bundleType)}ngOnDestroy(){this.subscriptions.destroyAll()}static{this.\u0275fac=function(r){return new(r||t)(l(ne),l(re),l(T),l(z),l(X),l(V),l(N),l(F))}}static{this.\u0275cmp=h({type:t,selectors:[["insta-karapace-rest-proxy-user-list"]],standalone:!1,decls:5,vars:3,consts:[["loading",""],[4,"ngIf","ngIfElse"],[4,"ngIf"],[3,"bundleType","bundleUserData","actions"],["type","warn"]],template:function(r,p){if(r&1&&(i(0,"insta-bundle-tab-wrapper"),f(1,De,4,3,"ng-container",1)(2,Ke,3,1,"ng-container",2)(3,Be,1,0,"ng-template",null,0,E),n()),r&2){let b=R(4);o(),s("ngIf",p.tableUserData)("ngIfElse",b),o(),s("ngIf",p.notificationBoxMessage)}},dependencies:[_,I,U,w,de],encapsulation:2})}}return t})();var ye=(()=>{class t{constructor(){this.bundleType=v.KarapaceRestProxy}ngOnInit(){}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275cmp=h({type:t,selectors:[["insta-karapace-rest-proxy-bundle-user-change-password"]],standalone:!1,decls:1,vars:2,consts:[[3,"bundleType","bundleSpecificSuffix"]],template:function(r,p){r&1&&c(0,"insta-bundle-user-change-password",0),r&2&&s("bundleType",p.bundleType)("bundleSpecificSuffix",". The nodes of the cluster may be busy. Please wait a while and try again")},dependencies:[ue],encapsulation:2})}}return t})();var je=[{path:"connection-info",component:xe},{path:"users",component:ge},{path:"users/:username/password",component:ye}],he=(()=>{class t{static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275mod=k({type:t})}static{this.\u0275inj=S({imports:[B.forChild(je),B]})}}return t})();var Ot=(()=>{class t{static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275mod=k({type:t})}static{this.\u0275inj=S({imports:[O,he,Q,me,le,J,ee,ce,fe]})}}return t})();export{Ot as KarapaceRestProxyModule};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.