mirror of
https://github.com/NLnetLabs/krill.git
synced 2026-09-26 19:34:51 +02:00
* Encrypt session state using ChaCha20-Poly1305 instead of AES-GCM. * Replace config file users login use of insecure unsalted SHA2 password hashing with secure scrypt salted password hashing. * Log the start of the request before determining the actor. * Allow sufficient time for password hashing delays during login with config file user based tests.. * Synced with Lagosta commit b49f23de.
56 lines
2.3 KiB
JavaScript
56 lines
2.3 KiB
JavaScript
// Team names and CAs they can access are defined in doc/policies/team-based-access-demo.polar.
|
|
// Team memberships and user roles within teams are defined in test-resources/ui/multi_user_team_based_access.conf.
|
|
// This test verifies that team roles and team CA rights work as expected, as defined in those files.
|
|
|
|
// A note about strong password hashing login delays
|
|
// -----------------------------------------------------------------------------
|
|
// The strong password hashing on the client and server side when logging in with
|
|
// config file users causes the login process to take a few seconds. As such we
|
|
// extend the default timeout when checking for Sign In completion, like so:
|
|
//
|
|
// cy.contains('Sign In', { timeout: 10000 }).should('not.exist')
|
|
|
|
let t1ro = { u: 'team1ro@krill', p: 'team1ro' };
|
|
let t1rw = { u: 'team1rw@krill', p: 'team1rw' };
|
|
let t2ro = { u: 'team2ro@krill', p: 'team2ro' };
|
|
let t2rw = { u: 'team2rw@krill', p: 'team2rw' };
|
|
|
|
let create_ca_test_settings = [
|
|
{ d: 't1ro', u: t1ro.u, p: t1ro.p, o: false, ca: 'ca1', t: 'Red Team', tr: 'Read Only' },
|
|
{ d: 't1rw', u: t1rw.u, p: t1rw.p, o: true, ca: 'ca1', t: 'Red Team', tr: 'Read Write' },
|
|
{ d: 't2ro', u: t2ro.u, p: t2ro.p, o: false, ca: 'ca2', t: 'Blue Team', tr: 'Read Only' },
|
|
{ d: 't2rw', u: t2rw.u, p: t2rw.p, o: true, ca: 'ca2', t: 'Blue Team', tr: 'Read Write' },
|
|
];
|
|
|
|
describe('Config File users with custom team policy', () => {
|
|
create_ca_test_settings.forEach(function (ts) {
|
|
it('Create CA as ' + ts.d + ' user should ' + (ts.o ? 'succeed' : 'fail'), () => {
|
|
cy.visit('/')
|
|
cy.get('#login_id').type(ts.u)
|
|
cy.get('#login_password').type(ts.p)
|
|
cy.contains('Sign In').click()
|
|
cy.contains('Sign In', { timeout: 10000 }).should('not.exist')
|
|
cy.contains(ts.u)
|
|
cy.contains('Welcome to Krill')
|
|
|
|
// verify our team and role
|
|
cy.get('#userinfo')
|
|
cy.get('#userinfo').click()
|
|
cy.get('#userinfo_table').contains(ts.t)
|
|
cy.get('#userinfo_table').contains(ts.tr)
|
|
|
|
// create a CA
|
|
cy.contains('CA Handle')
|
|
cy.get('form input[type="text"]').type(ts.ca)
|
|
cy.contains('Create CA').click()
|
|
cy.contains('OK').click()
|
|
|
|
// no longer on the welcome page
|
|
if (ts.o) {
|
|
cy.contains('Welcome to Krill').should('not.exist')
|
|
} else {
|
|
cy.contains('Welcome to Krill')
|
|
}
|
|
})
|
|
})
|
|
}) |