CI stack for Authentik with ldap

This commit is contained in:
Jamie Curnow
2024-11-03 13:17:24 +10:00
parent a277a5d167
commit 6e820a36ac
35 changed files with 116 additions and 172 deletions

View File

@ -1,4 +1,4 @@
/// <reference types="Cypress" />
/// <reference types="cypress" />
describe('Certificates endpoints', () => {
let token;

View File

@ -1,4 +1,4 @@
/// <reference types="Cypress" />
/// <reference types="cypress" />
describe('Full Certificate Provisions', () => {
let token;

View File

@ -1,4 +1,4 @@
/// <reference types="Cypress" />
/// <reference types="cypress" />
describe('Basic API checks', () => {
it('Should return a valid health payload', function() {

View File

@ -1,4 +1,4 @@
/// <reference types="Cypress" />
/// <reference types="cypress" />
// Settings are stored lowercase in the backend

View File

@ -1,4 +1,4 @@
/// <reference types="Cypress" />
/// <reference types="cypress" />
describe('Setup Phase', () => {
@ -8,15 +8,15 @@ describe('Setup Phase', () => {
it('Should NOT be able to get a token', function() {
cy.task('backendApiPost', {
path: '/api/tokens',
path: '/api/auth',
data: {
type: 'password',
type: 'local',
identity: 'cypress@example.com',
secret: 'changeme'
},
returnOnError: true
}).then((data) => {
cy.validateSwaggerSchema('post', 403, '/tokens', data);
cy.validateSwaggerSchema('post', 403, '/auth', data);
expect(data.error).to.have.property('code', 403);
expect(data.error).to.have.property('message', 'Not available during setup phase');
});

View File

@ -1,4 +1,4 @@
/// <reference types="Cypress" />
/// <reference types="cypress" />
describe('Swagger Schema Checks', () => {
it('Should be valid with swagger-validator', function() {

View File

@ -1,4 +1,4 @@
/// <reference types="Cypress" />
/// <reference types="cypress" />
describe('Upstream endpoints', () => {
let token;

View File

@ -1,4 +1,4 @@
/// <reference types="Cypress" />
/// <reference types="cypress" />
describe('Users endpoints', () => {
let token;
@ -82,11 +82,10 @@ describe('Users endpoints', () => {
path: '/api/users',
data: {
name: 'Example user 1',
nickname: 'User1',
email: uniqueEmail,
is_disabled: false,
auth: {
type: 'password',
type: 'local',
secret: 'changeme'
},
capabilities: [
@ -108,11 +107,10 @@ describe('Users endpoints', () => {
returnOnError: true,
data: {
name: 'Example user 2',
nickname: 'User2',
email: uniqueEmail,
is_disabled: false,
auth: {
type: 'password',
type: 'local',
secret: 'changeme'
},
capabilities: [

View File

@ -1,4 +1,4 @@
/// <reference types="Cypress" />
/// <reference types="cypress" />
describe('UI Setup and Login', () => {
@ -10,7 +10,6 @@ describe('UI Setup and Login', () => {
it('Should be able to setup a new user', function() {
cy.visit('/');
cy.get('input[name="name"]').type('Cypress McGee');
cy.get('input[name="nickname"]').type('Cypress');
cy.get('input[name="email"]').type('cypress@example.com');
cy.get('input[name="password"]').type('changeme');
cy.get('form button:last').click();

View File

@ -66,7 +66,7 @@ Cypress.Commands.add('getToken', (defaultUser, defaultAuth) => {
});
} else {
let auth = {
type: 'password',
type: 'local',
identity: 'cypress@example.com',
secret: 'changeme',
};
@ -78,7 +78,7 @@ Cypress.Commands.add('getToken', (defaultUser, defaultAuth) => {
cy.log('Setup = true');
// login with existing user
cy.task('backendApiPost', {
path: '/api/tokens',
path: '/api/auth',
data: auth,
}).then((res) => {
cy.wrap(res.result.token);
@ -90,11 +90,10 @@ Cypress.Commands.add('getToken', (defaultUser, defaultAuth) => {
Cypress.Commands.add('createInitialUser', (defaultUser) => {
let user = {
name: 'Cypress McGee',
nickname: 'Cypress',
email: 'cypress@example.com',
is_disabled: false,
auth: {
type: 'password',
type: 'local',
secret: 'changeme'
},
capabilities: ['full-admin']