Fix incorrect authentikm url in cypress test

This commit is contained in:
Jamie Curnow 2024-11-13 08:24:55 +10:00
parent 050c087a51
commit 03b3b6379b
No known key found for this signature in database
GPG Key ID: FFBB624C43388E9E
4 changed files with 12 additions and 6 deletions

View File

@ -16,6 +16,9 @@ module.exports = defineConfig({
},
env: {
swaggerBase: '{{baseUrl}}/api/schema',
authentik: 'http://authentik:9000',
authentikLdap: 'authentik-ldap:3389',
oauthRedirect: 'http://fullstack:81',
},
baseUrl: 'http://localhost:1234',
},

View File

@ -15,6 +15,9 @@ module.exports = defineConfig({
},
env: {
swaggerBase: '{{baseUrl}}/api/schema',
authentik: 'http://authentik:9000',
authentikLdap: 'authentik-ldap:3389',
oauthRedirect: 'http://npm:81',
},
}
});

View File

@ -14,7 +14,7 @@ describe('LDAP with Authentik', () => {
path: '/api/settings/ldap-auth',
data: {
value: {
host: 'authentik-ldap:3389',
host: Cypress.env('authentik-ldap'),
base_dn: 'ou=users,DC=ldap,DC=goauthentik,DC=io',
user_dn: 'cn={{USERNAME}},ou=users,DC=ldap,DC=goauthentik,DC=io',
email_property: 'mail',

View File

@ -16,10 +16,10 @@ describe('OAuth with Authentik', () => {
value: {
client_id: 'U5gCy0ymU8OofWS4nmkAPugCbWkFkkPztap38ReD',
client_secret: '9ZFClxwp7LzbfhIDk7k9DngQNQfwDAYqPrQMGXjFumCvQZATtXCwme20o0TnLP6uEHUkKqEFOInhxp01gVeaHCLW83iTK4PonoUnpFnXgyZAcu0H3zBxxOkVtRwACaoW',
authorization_url: 'http://authentik-ldap:9000/application/o/authorize/',
resource_url: 'http://authentik-ldap:9000/application/o/userinfo/',
token_url: 'http://authentik-ldap:9000/application/o/token/',
logout_url: 'http://authentik-ldap:9000/application/o/npm3/end-session/',
authorization_url: Cypress.env('authentik') + '/application/o/authorize/',
resource_url: Cypress.env('authentik') + '/application/o/userinfo/',
token_url: Cypress.env('authentik') + '/application/o/token/',
logout_url: Cypress.env('authentik') + '/application/o/npm3/end-session/',
identifier: 'preferred_username',
scopes: [],
auto_create_user: true
@ -51,7 +51,7 @@ describe('OAuth with Authentik', () => {
it('Should log in with OAuth', function() {
cy.task('backendApiGet', {
token: token,
path: '/oauth/login?redirect_base=http%3A%2F%2Ffullstack%3A81',
path: '/oauth/login?redirect_base=' + encodeURI(Cypress.env('oauthRedirect')),
}).then((data) => {
expect(data).to.have.property('result');
cy.visit(data.result);