diff --git a/src/frontend/packages/cloud-foundry/src/features/cf/user-invites/user-invite.service.ts b/src/frontend/packages/cloud-foundry/src/features/cf/user-invites/user-invite.service.ts index 637a1cbd09..6ebb948cbc 100644 --- a/src/frontend/packages/cloud-foundry/src/features/cf/user-invites/user-invite.service.ts +++ b/src/frontend/packages/cloud-foundry/src/features/cf/user-invites/user-invite.service.ts @@ -143,12 +143,11 @@ export class UserInviteService { map(v => v.entity.metadata && v.entity.metadata.userInviteAllowed === 'true') ); - this.canConfigure$ = combineLatest([ + this.canConfigure$ = combineLatest( waitForCFPermissions(this.store, this.activeRouteCfOrgSpace.cfGuid), - this.store.select('auth'), - cfEndpointService.endpoint$ - ]).pipe( - map(([cf, auth, endpoint]) => + this.store.select('auth') + ).pipe( + map(([cf, auth]) => cf.global.isAdmin && auth.sessionData['plugin-config'] && auth.sessionData['plugin-config'].userInvitationsEnabled === 'true') ); diff --git a/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint-cf-step-1/create-endpoint-cf-step-1.component.ts b/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint-cf-step-1/create-endpoint-cf-step-1.component.ts index e924b43185..b21d80f862 100644 --- a/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint-cf-step-1/create-endpoint-cf-step-1.component.ts +++ b/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint-cf-step-1/create-endpoint-cf-step-1.component.ts @@ -1,7 +1,6 @@ import { AfterContentInit, Component, Input } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { ActivatedRoute } from '@angular/router'; -import { StratosCurrentUserPermissions } from '../../../../core/permissions/stratos-user-permissions.checker'; import { Observable } from 'rxjs'; import { filter, map, pairwise } from 'rxjs/operators'; @@ -12,13 +11,14 @@ import { } from '../../../../../../store/src/entity-catalog/entity-catalog-entity/entity-catalog-entity'; import { ActionState } from '../../../../../../store/src/reducers/api-request-reducer/types'; import { stratosEntityCatalog } from '../../../../../../store/src/stratos-entity-catalog'; +import { StratosCurrentUserPermissions } from '../../../../core/permissions/stratos-user-permissions.checker'; import { getIdFromRoute } from '../../../../core/utils.service'; import { IStepperStep, StepOnNextFunction } from '../../../../shared/components/stepper/step/step.component'; +import { SessionService } from '../../../../shared/services/session.service'; import { SnackBarService } from '../../../../shared/services/snackbar.service'; import { ConnectEndpointConfig } from '../../connect.service'; import { getSSOClientRedirectURI } from '../../endpoint-helpers'; -import { SessionService } from '../../../../shared/services/session.service'; -import { CreateEndpointHelperComponent } from '../create-endpoint-helper/create-endpoint-helper.component'; +import { CreateEndpointHelperComponent } from '../create-endpoint-helper'; @Component({ diff --git a/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint-helper/create-endpoint-helper.component.ts b/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint-helper.ts similarity index 71% rename from src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint-helper/create-endpoint-helper.component.ts rename to src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint-helper.ts index 08551dfbe5..a7d24ce0aa 100644 --- a/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint-helper/create-endpoint-helper.component.ts +++ b/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint-helper.ts @@ -1,21 +1,16 @@ -import { Component } from '@angular/core'; -import { StratosCurrentUserPermissions } from '../../../../core/permissions/stratos-user-permissions.checker'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { getFullEndpointApiUrl } from '../../../../../../store/src/endpoint-utils'; -import { stratosEntityCatalog } from '../../../../../../store/src/stratos-entity-catalog'; -import { SessionService } from '../../../../shared/services/session.service'; +import { getFullEndpointApiUrl } from '../../../../../store/src/endpoint-utils'; +import { stratosEntityCatalog } from '../../../../../store/src/stratos-entity-catalog'; +import { StratosCurrentUserPermissions } from '../../../core/permissions/stratos-user-permissions.checker'; +import { SessionService } from '../../../shared/services/session.service'; type EndpointObservable = Observable<{ names: string[], urls: string[], }>; -@Component({ - selector: 'app-create-endpoint-helper', - template: '' -}) export class CreateEndpointHelperComponent { overwritePermission: Observable; diff --git a/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint-helper/create-endpoint-helper.component.spec.ts b/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint-helper/create-endpoint-helper.component.spec.ts deleted file mode 100644 index 7ea0d22cbb..0000000000 --- a/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint-helper/create-endpoint-helper.component.spec.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { SessionService } from 'frontend/packages/core/src/shared/services/session.service'; -import { createBasicStoreModule } from '@stratosui/store/testing'; -import { CreateEndpointHelperComponent } from './create-endpoint-helper.component'; -import { CoreTestingModule } from '../../../../../test-framework/core-test.modules'; - -describe('CreateEndpointHelperComponent', () => { - let component: CreateEndpointHelperComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ CreateEndpointHelperComponent ], - imports: [ - CoreTestingModule, - createBasicStoreModule(), - ], - providers: [ SessionService ] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(CreateEndpointHelperComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint.module.ts b/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint.module.ts index 1505415ee2..f747ece74c 100644 --- a/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint.module.ts +++ b/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint.module.ts @@ -8,7 +8,6 @@ import { CreateEndpointBaseStepComponent } from './create-endpoint-base-step/cre import { CreateEndpointCfStep1Component } from './create-endpoint-cf-step-1/create-endpoint-cf-step-1.component'; import { CreateEndpointConnectComponent } from './create-endpoint-connect/create-endpoint-connect.component'; import { CreateEndpointComponent } from './create-endpoint.component'; -import { CreateEndpointHelperComponent } from './create-endpoint-helper/create-endpoint-helper.component'; @NgModule({ imports: [ @@ -22,14 +21,12 @@ import { CreateEndpointHelperComponent } from './create-endpoint-helper/create-e CreateEndpointBaseStepComponent, CreateEndpointConnectComponent, ConnectEndpointComponent, - CreateEndpointHelperComponent ], exports: [ CreateEndpointComponent, CreateEndpointCfStep1Component, CreateEndpointConnectComponent, ConnectEndpointComponent, - CreateEndpointHelperComponent ] }) export class CreateEndpointModule { } diff --git a/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/endpoint-list.helpers.ts b/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/endpoint-list.helpers.ts index 5a8fa03b98..48b2a33208 100644 --- a/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/endpoint-list.helpers.ts +++ b/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/endpoint-list.helpers.ts @@ -1,4 +1,3 @@ -import { isNgTemplate } from '@angular/compiler'; import { ComponentFactoryResolver, ComponentRef, Injectable, ViewContainerRef } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { Store } from '@ngrx/store'; @@ -16,13 +15,13 @@ import { StratosCurrentUserPermissions } from '../../../../../core/permissions/s import { ConnectEndpointDialogComponent, } from '../../../../../features/endpoints/connect-endpoint-dialog/connect-endpoint-dialog.component'; +import { SessionService } from '../../../../../shared/services/session.service'; import { SnackBarService } from '../../../../services/snackbar.service'; import { ConfirmationDialogConfig } from '../../../confirmation-dialog.config'; import { ConfirmationDialogService } from '../../../confirmation-dialog.service'; import { createMetaCardMenuItemSeparator } from '../../list-cards/meta-card/meta-card-base/meta-card.component'; import { IListAction } from '../../list.component.types'; import { TableCellCustom } from '../../list.types'; -import { SessionService } from '../../../../../shared/services/session.service'; interface EndpointDetailsContainerRefs { componentRef: ComponentRef; @@ -111,9 +110,9 @@ export class EndpointListHelper { label: 'Disconnect', description: ``, // Description depends on console user permission createVisible: (row$: Observable) => combineLatest([ - this.currentUserPermissionsService.can(StratosCurrentUserPermissions.EDIT_ADMIN_ENDPOINT), - row$ - ]).pipe( + this.currentUserPermissionsService.can(StratosCurrentUserPermissions.EDIT_ADMIN_ENDPOINT), + row$ + ]).pipe( map(([isAdmin, row]) => { const isConnected = row.connectionStatus === 'connected'; return isConnected && (!row.system_shared_token || row.system_shared_token && isAdmin); @@ -142,9 +141,11 @@ export class EndpointListHelper { row$ ]).pipe( map(([userEndpointsEnabled, isAdmin, row]) => { - if (userEndpointsEnabled && !row.creator.admin && isAdmin){ + if (userEndpointsEnabled && !row.creator.admin && isAdmin) { + // Disable connect for admins if the endpoint was not created by them. Otherwise this could result in an admin connecting to + // multiple user endpoints that all have the same url. return false; - }else{ + } else { const endpoint = entityCatalog.getEndpoint(row.cnsi_type, row.sub_type); const ep = endpoint ? endpoint.definition : { unConnectable: false }; return !ep.unConnectable && row.connectionStatus === 'disconnected'; @@ -178,9 +179,9 @@ export class EndpointListHelper { row$ ]).pipe( map(([userEndpointsEnabled, isAdmin, isEndpointAdmin, row]) => { - if (!userEndpointsEnabled || row.creator.admin){ + if (!userEndpointsEnabled || row.creator.admin) { return isAdmin; - }else{ + } else { return isEndpointAdmin || isAdmin; } }) @@ -202,9 +203,9 @@ export class EndpointListHelper { row$ ]).pipe( map(([userEndpointsEnabled, isAdmin, isEndpointAdmin, row]) => { - if (!userEndpointsEnabled || row.creator.admin){ + if (!userEndpointsEnabled || row.creator.admin) { return isAdmin; - }else{ + } else { return isEndpointAdmin || isAdmin; } }) diff --git a/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/endpoints-list-config.service.ts b/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/endpoints-list-config.service.ts index 4c165becef..e1205627b4 100644 --- a/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/endpoints-list-config.service.ts +++ b/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/endpoints-list-config.service.ts @@ -1,7 +1,7 @@ -import { Injectable, OnDestroy } from '@angular/core'; +import { Injectable } from '@angular/core'; import { Store } from '@ngrx/store'; -import { BehaviorSubject, combineLatest, of, Subscription } from 'rxjs'; -import { debounceTime, filter, map } from 'rxjs/operators'; +import { BehaviorSubject, combineLatest, of } from 'rxjs'; +import { debounceTime, filter, first, map } from 'rxjs/operators'; import { ListView } from '../../../../../../../store/src/actions/list.actions'; import { SetClientFilter } from '../../../../../../../store/src/actions/pagination.actions'; @@ -29,7 +29,6 @@ import { EndpointCardComponent } from './endpoint-card/endpoint-card.component'; import { EndpointListHelper } from './endpoint-list.helpers'; import { EndpointsDataSource } from './endpoints-data-source'; import { TableCellEndpointAddressComponent } from './table-cell-endpoint-address/table-cell-endpoint-address.component'; -import { TableCellEndpointCreatorComponent } from './table-cell-endpoint-creator/table-cell-endpoint-creator.component'; import { TableCellEndpointDetailsComponent } from './table-cell-endpoint-details/table-cell-endpoint-details.component'; import { TableCellEndpointNameComponent } from './table-cell-endpoint-name/table-cell-endpoint-name.component'; import { TableCellEndpointStatusComponent } from './table-cell-endpoint-status/table-cell-endpoint-status.component'; @@ -37,7 +36,7 @@ import { TableCellEndpointStatusComponent } from './table-cell-endpoint-status/t @Injectable() -export class EndpointsListConfigService implements IListConfig, OnDestroy { +export class EndpointsListConfigService implements IListConfig { cardComponent = EndpointCardComponent; private singleActions: IListAction[]; @@ -109,7 +108,6 @@ export class EndpointsListConfigService implements IListConfig, O filter: 'Filter Endpoints' }; enableTextFilter = true; - userEndpointsSubscription: Subscription; constructor( private store: Store, @@ -125,12 +123,14 @@ export class EndpointsListConfigService implements IListConfig, O (row: EndpointModel) => userFavoriteManager.getFavoriteEndpointFromEntity(row) ); this.columns.push(favoriteCell); - this.userEndpointsSubscription = sessionService.userEndpointsNotDisabled().subscribe(enabled => { - if (enabled){ + sessionService.userEndpointsNotDisabled().pipe(first()).subscribe(enabled => { + if (enabled) { this.columns.splice(4, 0, { columnId: 'creator', headerCell: () => 'Creator', - cellComponent: TableCellEndpointCreatorComponent, + cellDefinition: { + valuePath: 'creator.name' + }, sort: { type: 'sort', orderKey: 'creator', @@ -221,7 +221,4 @@ export class EndpointsListConfigService implements IListConfig, O } } - ngOnDestroy() { - this.userEndpointsSubscription.unsubscribe(); - } } diff --git a/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/table-cell-endpoint-creator/table-cell-endpoint-creator.component.html b/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/table-cell-endpoint-creator/table-cell-endpoint-creator.component.html deleted file mode 100644 index 550579e875..0000000000 --- a/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/table-cell-endpoint-creator/table-cell-endpoint-creator.component.html +++ /dev/null @@ -1,3 +0,0 @@ -
- {{ creator }} -
\ No newline at end of file diff --git a/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/table-cell-endpoint-creator/table-cell-endpoint-creator.component.scss b/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/table-cell-endpoint-creator/table-cell-endpoint-creator.component.scss deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/table-cell-endpoint-creator/table-cell-endpoint-creator.component.spec.ts b/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/table-cell-endpoint-creator/table-cell-endpoint-creator.component.spec.ts deleted file mode 100644 index df3ba7cf20..0000000000 --- a/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/table-cell-endpoint-creator/table-cell-endpoint-creator.component.spec.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { CoreModule } from '@stratosui/core'; -import { EndpointModel } from '@stratosui/store'; - -import { TableCellEndpointCreatorComponent } from './table-cell-endpoint-creator.component'; - -describe('TableCellEndpointCreatorComponent', () => { - let component: TableCellEndpointCreatorComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ TableCellEndpointCreatorComponent ], - imports: [ - CoreModule - ] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(TableCellEndpointCreatorComponent); - component = fixture.componentInstance; - component.row = { - creator: { - name: 'dummy' - } - } as EndpointModel; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/table-cell-endpoint-creator/table-cell-endpoint-creator.component.ts b/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/table-cell-endpoint-creator/table-cell-endpoint-creator.component.ts deleted file mode 100644 index 16e53eb05c..0000000000 --- a/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/table-cell-endpoint-creator/table-cell-endpoint-creator.component.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { EndpointModel, entityCatalog } from '@stratosui/store'; -import { TableCellCustom } from '../../../list.types'; - -@Component({ - selector: 'app-table-cell-endpoint-creator', - templateUrl: './table-cell-endpoint-creator.component.html', - styleUrls: ['./table-cell-endpoint-creator.component.scss'] -}) -export class TableCellEndpointCreatorComponent extends TableCellCustom implements OnInit { - - public creator = ''; - - @Input() - get row(): EndpointModel { - return super.row; - } - set row(row: EndpointModel) { - super.row = row; - } - - constructor() { - super(); - } - - ngOnInit(): void { - this.creator = this.row.creator.name; - } - -} diff --git a/src/frontend/packages/core/src/shared/shared.module.ts b/src/frontend/packages/core/src/shared/shared.module.ts index b6c54ff774..38a45ca14b 100644 --- a/src/frontend/packages/core/src/shared/shared.module.ts +++ b/src/frontend/packages/core/src/shared/shared.module.ts @@ -119,7 +119,6 @@ import { LongRunningOperationsService } from './services/long-running-op.service import { MetricsRangeSelectorService } from './services/metrics-range-selector.service'; import { SessionService } from './services/session.service'; import { UserPermissionDirective } from './user-permission.directive'; -import { TableCellEndpointCreatorComponent } from './components/list/list-types/endpoint/table-cell-endpoint-creator/table-cell-endpoint-creator.component'; @NgModule({ @@ -222,7 +221,6 @@ import { TableCellEndpointCreatorComponent } from './components/list/list-types/ CardProgressOverlayComponent, MaxListMessageComponent, ProfileSettingsComponent, - TableCellEndpointCreatorComponent, ], exports: [ ApplicationStateIconPipe, diff --git a/src/frontend/packages/git/src/shared/components/git-registration/git-registration.component.ts b/src/frontend/packages/git/src/shared/components/git-registration/git-registration.component.ts index ddfb95dcf9..a4ed8d5c5d 100644 --- a/src/frontend/packages/git/src/shared/components/git-registration/git-registration.component.ts +++ b/src/frontend/packages/git/src/shared/components/git-registration/git-registration.component.ts @@ -1,14 +1,17 @@ import { Component, OnDestroy } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { ActivatedRoute } from '@angular/router'; +import { + CreateEndpointHelperComponent, +} from 'frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint-helper'; import { Observable, Subscription } from 'rxjs'; import { filter, first, map, pairwise } from 'rxjs/operators'; -import { SessionService } from '../../../../../core/src/shared/services/session.service'; import { EndpointsService } from '../../../../../core/src/core/endpoints.service'; import { getIdFromRoute } from '../../../../../core/src/core/utils.service'; import { ConnectEndpointConfig } from '../../../../../core/src/features/endpoints/connect.service'; import { StepOnNextFunction } from '../../../../../core/src/shared/components/stepper/step/step.component'; +import { SessionService } from '../../../../../core/src/shared/services/session.service'; import { SnackBarService } from '../../../../../core/src/shared/services/snackbar.service'; import { getFullEndpointApiUrl } from '../../../../../store/src/endpoint-utils'; import { entityCatalog } from '../../../../../store/src/public-api'; @@ -16,7 +19,6 @@ import { ActionState } from '../../../../../store/src/reducers/api-request-reduc import { stratosEntityCatalog } from '../../../../../store/src/stratos-entity-catalog'; import { GIT_ENDPOINT_SUB_TYPES, GIT_ENDPOINT_TYPE } from '../../../store/git-entity-factory'; import { GitSCMService } from '../../scm/scm.service'; -import { CreateEndpointHelperComponent } from 'frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint-helper/create-endpoint-helper.component'; interface EndpointSubTypes { [subType: string]: GithubTypes; diff --git a/src/frontend/packages/store/src/types/auth.types.ts b/src/frontend/packages/store/src/types/auth.types.ts index 619e5665cf..c12d9cd835 100644 --- a/src/frontend/packages/store/src/types/auth.types.ts +++ b/src/frontend/packages/store/src/types/auth.types.ts @@ -28,8 +28,17 @@ export enum APIKeysEnabled { ALL_USERS = 'all_users' } export enum UserEndpointsEnabled { + /** + * No users can see or create their own endpoints. Admins cannot see any previously created user endpoints. + */ DISABLED = 'disabled', + /** + * No users can see or create their own endpoints. Admins can manage previously created user endpoints + */ ADMIN_ONLY = 'admin_only', + /** + * Endpoint Admins can see and create their own endpoints. Admins can manage all user endpoints + */ ENABLED = 'enabled' } export interface SessionDataConfig { diff --git a/src/jetstream/cnsi.go b/src/jetstream/cnsi.go index bc1511a1ad..e9eb7a2db0 100644 --- a/src/jetstream/cnsi.go +++ b/src/jetstream/cnsi.go @@ -74,7 +74,7 @@ func (p *portalProxy) RegisterEndpoint(c echo.Context, fetchInfo interfaces.Info cnsiClientSecret = p.GetConfig().CFClientSecret } - uaaUserID, err := p.GetSessionStringValue(c, "user_id") + userID, err := p.GetSessionStringValue(c, "user_id") if err != nil { return interfaces.NewHTTPShadowError( http.StatusInternalServerError, @@ -82,7 +82,7 @@ func (p *portalProxy) RegisterEndpoint(c echo.Context, fetchInfo interfaces.Info "Failed to get session user: %v", err) } - newCNSI, err := p.DoRegisterEndpoint(params.CNSIName, params.APIEndpoint, skipSSLValidation, cnsiClientId, cnsiClientSecret, uaaUserID, ssoAllowed, subType, overwriteEndpoints, fetchInfo) + newCNSI, err := p.DoRegisterEndpoint(params.CNSIName, params.APIEndpoint, skipSSLValidation, cnsiClientId, cnsiClientSecret, userID, ssoAllowed, subType, overwriteEndpoints, fetchInfo) if err != nil { return err } @@ -171,6 +171,7 @@ func (p *portalProxy) DoRegisterEndpoint(cnsiName string, apiEndpoint string, sk if isAdmin && overwriteEndpoints { for _, duplicate := range duplicateEndpoints { + log.Infof("An administrator is registering an endpoint with the same API URL ('%+v') as an endpoint administrator's. The existing duplicate endpoint ('$+v') will be removed", apiEndpoint, duplicate.GUID) err := p.doUnregisterCluster(duplicate.GUID) if err != nil { return interfaces.CNSIRecord{}, interfaces.NewHTTPShadowError( @@ -187,6 +188,7 @@ func (p *portalProxy) DoRegisterEndpoint(cnsiName string, apiEndpoint string, sk h := sha1.New() // see why its generated this way in Issue #4753 / #3031 if p.GetConfig().UserEndpointsEnabled != config.UserEndpointsConfigEnum.Disabled && !isAdmin { + // Make the new guid unique per api url AND user id h.Write([]byte(apiEndpointURL.String() + userId)) } else { h.Write([]byte(apiEndpointURL.String())) @@ -321,7 +323,7 @@ func (p *portalProxy) ListEndpoints() ([]*interfaces.CNSIRecord, error) { return cnsiList, nil } -//return a CNSI list with endpoints created by the current endpointadmin and all admins +// ListAdminEndpoints - return a CNSI list with endpoints created by the current user and all admins func (p *portalProxy) ListAdminEndpoints(userID string) ([]*interfaces.CNSIRecord, error) { log.Debug("ListAdminEndpoints") // Initialise cnsiList to ensure empty struct (marshals to null) is not returned diff --git a/src/jetstream/plugins/backup/main.go b/src/jetstream/plugins/backup/main.go index 72d23b4833..cf1032ea15 100644 --- a/src/jetstream/plugins/backup/main.go +++ b/src/jetstream/plugins/backup/main.go @@ -57,7 +57,7 @@ func (br *BackupRestore) AddSessionGroupRoutes(echoGroup *echo.Group) { func (br *BackupRestore) Init() error { enabledStr := br.portalProxy.Env().String("FEATURE_ALLOW_BACKUP", "true") if enabled, err := strconv.ParseBool(enabledStr); err == nil && !enabled { - return errors.New("Backup/restoure feature disabled via configuration") + return errors.New("Backup/restore feature disabled via configuration") } return nil diff --git a/website/sidebars.js b/website/sidebars.js index 9d38f14e6e..251a3d4a96 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -31,7 +31,8 @@ module.exports = { { 'Cloud Foundry': [ 'endpoints/cf/cf', - 'endpoints/cf/invite-user-guide' + 'endpoints/cf/invite-user-guide', + 'endpoints/cf/user-endpoints' ] }, 'endpoints/k8s',