Skip to content

Commit

Permalink
fix: hide auth strategy if public (#458)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidma415 authored Mar 6, 2024
1 parent 31d67df commit 041df46
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
21 changes: 20 additions & 1 deletion cypress/e2e/specs/spec_renderer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ describe('Spec Renderer Page', () => {
cy.visit(`/spec/${product.id}`)

cy.get('[data-testid="kong-public-ui-spec-details-swagger"]', { timeout: 12000 })
.get('.info h2').should('contain', 'Swagger Petstore')
.get('.info h2').should('contain', 'Swagger Petstore')

cy.get('[data-testid="register-button"]').should('exist')

Expand Down Expand Up @@ -427,5 +427,24 @@ describe('Spec Renderer Page', () => {

cy.get('@apiNotCalled').should('not.been.called')
})
it.only('appregv2 - does not show auth strategy information if public portal', () => {
cy.mockLaunchDarklyFlags([
{
name: 'tdx-3531-app-reg-v2',
value: true
}
])

cy.intercept('GET', '**/portal_api/portal/portal_context', {
rbac_enabled: true
}).as('getPortalContext')

cy.visit(`/spec/${product.id}`)

cy.get('[data-testid="kong-public-ui-spec-details-swagger"]', { timeout: 12000 })
.get('.info h2').should('contain', 'Swagger Petstore')

cy.get('[data-testid="auth-strategy-card"]', { timeout: 1000 }).should('not.exist')
})
})
})
2 changes: 1 addition & 1 deletion src/views/Spec.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="container max-w-screen-2xl px-5 md:px-0">
<div class="swagger-ui has-sidebar breadcrumbs">
<KCard
v-if="appRegV2Enabled && applicationRegistrationEnabled && currentVersion?.registration_configs?.length"
v-if="appRegV2Enabled && applicationRegistrationEnabled && currentVersion?.registration_configs?.length && !isPublic"
class="auth-strategy-card"
data-testid="auth-strategy-card"
>
Expand Down

0 comments on commit 041df46

Please sign in to comment.