diff --git a/web-app/src/app/admin/admin-authentication/admin-authentication-ldap/admin-authentication-ldap.component.html b/web-app/src/app/admin/admin-authentication/admin-authentication-ldap/admin-authentication-ldap.component.html index 5dc7e0a29..dc6f7f1b7 100644 --- a/web-app/src/app/admin/admin-authentication/admin-authentication-ldap/admin-authentication-ldap.component.html +++ b/web-app/src/app/admin/admin-authentication/admin-authentication-ldap/admin-authentication-ldap.component.html @@ -43,7 +43,9 @@

User Search

Search Scope - {{ scope.viewValue }} + @for (scope of scopes; track scope.value) { + {{ scope.viewValue }} + } Scope of the search. Default: sub. @@ -68,7 +70,9 @@

Group Search

Group Search Scope - {{ scope.viewValue }} + @for (scope of scopes; track scope.value) { + {{ scope.viewValue }} + } Scope of the search. Default: sub. diff --git a/web-app/src/app/admin/admin-authentication/admin-authentication-ldap/admin-authentication-ldap.component.spec.ts b/web-app/src/app/admin/admin-authentication/admin-authentication-ldap/admin-authentication-ldap.component.spec.ts index d99f6a8c9..4e96cc7f9 100644 --- a/web-app/src/app/admin/admin-authentication/admin-authentication-ldap/admin-authentication-ldap.component.spec.ts +++ b/web-app/src/app/admin/admin-authentication/admin-authentication-ldap/admin-authentication-ldap.component.spec.ts @@ -9,7 +9,7 @@ describe('AdminAuthenticationLDAPComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ AdminAuthenticationLDAPComponent ], + imports: [ AdminAuthenticationLDAPComponent ], schemas: [ CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA ] }) .compileComponents(); diff --git a/web-app/src/app/admin/admin-authentication/admin-authentication-ldap/admin-authentication-ldap.component.ts b/web-app/src/app/admin/admin-authentication/admin-authentication-ldap/admin-authentication-ldap.component.ts index ac6614b21..d7e90d1b5 100644 --- a/web-app/src/app/admin/admin-authentication/admin-authentication-ldap/admin-authentication-ldap.component.ts +++ b/web-app/src/app/admin/admin-authentication/admin-authentication-ldap/admin-authentication-ldap.component.ts @@ -1,5 +1,10 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { Strategy } from '../../admin-authentication/admin-settings.model'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { FormsModule } from '@angular/forms'; +import { MatSelectModule } from '@angular/material/select'; +import { MatInputModule } from '@angular/material/input'; +import { MatExpansionModule } from '@angular/material/expansion'; interface Scope { value: string; @@ -10,7 +15,14 @@ interface Scope { selector: 'admin-authentication-ldap', templateUrl: './admin-authentication-ldap.component.html', styleUrls: ['./admin-authentication-ldap.component.scss'], - standalone: false + standalone: true, + imports: [ + MatFormFieldModule, + FormsModule, + MatSelectModule, + MatInputModule, + MatExpansionModule, + ] }) export class AdminAuthenticationLDAPComponent implements OnInit { diff --git a/web-app/src/app/admin/admin-authentication/admin-authentication-local/account-lock/account-lock.component.html b/web-app/src/app/admin/admin-authentication/admin-authentication-local/account-lock/account-lock.component.html index c4abd51fe..38185df04 100644 --- a/web-app/src/app/admin/admin-authentication/admin-authentication-local/account-lock/account-lock.component.html +++ b/web-app/src/app/admin/admin-authentication/admin-authentication-local/account-lock/account-lock.component.html @@ -4,12 +4,14 @@

Account Lock

Account Lock - {{ choice.title }} + @for (choice of accountLockChoices; track choice.value) { + {{ choice.title }} + } MAGE can lock user accounts after a number of invalid login attempts for a certain amount of time. - +@if (strategy.settings.accountLock.enabled) {

Account Lockout Threshold

Account Lock Max Lockout - {{ choice.title }} + @for (choice of maxLockChoices; track choice.value) { + {{ choice.title }} + } MAGE can disable user accounts if a user locks their account a certain number of times. - + @if (maxLock.enabled) {

Max Lockout Threshold

Number of times a user account can be locked before it is disabled. Disabled accounts must be re-enabled by an admin. -
-
+ } +} \ No newline at end of file diff --git a/web-app/src/app/admin/admin-authentication/admin-authentication-local/account-lock/account-lock.component.ts b/web-app/src/app/admin/admin-authentication/admin-authentication-local/account-lock/account-lock.component.ts index dd640ba40..2b4d20b55 100644 --- a/web-app/src/app/admin/admin-authentication/admin-authentication-local/account-lock/account-lock.component.ts +++ b/web-app/src/app/admin/admin-authentication/admin-authentication-local/account-lock/account-lock.component.ts @@ -1,13 +1,23 @@ import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core'; import { Strategy, AdminChoice } from '../../../admin-authentication/admin-settings.model'; import { MaxLock } from './account-lock.model'; +import { FormsModule } from '@angular/forms'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatSelectModule } from '@angular/material/select'; +import { MatInputModule } from '@angular/material/input'; @Component({ selector: 'account-lock', templateUrl: 'account-lock.component.html', styleUrls: ['./account-lock.component.scss'], - standalone: false + standalone: true, + imports: [ + FormsModule, + MatFormFieldModule, + MatSelectModule, + MatInputModule + ] }) export class AccountLockComponent implements OnInit { @Input() strategy: Strategy; @@ -22,6 +32,7 @@ export class AccountLockComponent implements OnInit { description: 'Lock MAGE user accounts for defined time \n after defined number of invalid login attempts.', value: true }]; + // no signal - set once maxLock: MaxLock = { enabled: false }; diff --git a/web-app/src/app/admin/admin-authentication/admin-authentication-local/admin-authentication-local.component.spec.ts b/web-app/src/app/admin/admin-authentication/admin-authentication-local/admin-authentication-local.component.spec.ts index b15b68a9d..ed7c13dff 100644 --- a/web-app/src/app/admin/admin-authentication/admin-authentication-local/admin-authentication-local.component.spec.ts +++ b/web-app/src/app/admin/admin-authentication/admin-authentication-local/admin-authentication-local.component.spec.ts @@ -8,7 +8,7 @@ describe('AdminAuthenticationLocalComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [AdminAuthenticationLocalComponent], + imports: [AdminAuthenticationLocalComponent], schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA] }).compileComponents(); })); @@ -16,6 +16,17 @@ describe('AdminAuthenticationLocalComponent', () => { beforeEach(() => { fixture = TestBed.createComponent(AdminAuthenticationLocalComponent); component = fixture.componentInstance; + component.strategy = { + enabled: true, + name: 'local', + type: 'local', + textColor: '#000000', + buttonColor: '#ffffff', + settings: { + accountLock: { enabled: false }, + passwordPolicy: {} + } + }; fixture.detectChanges(); }); diff --git a/web-app/src/app/admin/admin-authentication/admin-authentication-local/admin-authentication-local.component.ts b/web-app/src/app/admin/admin-authentication/admin-authentication-local/admin-authentication-local.component.ts index 5cf756c44..40229055c 100644 --- a/web-app/src/app/admin/admin-authentication/admin-authentication-local/admin-authentication-local.component.ts +++ b/web-app/src/app/admin/admin-authentication/admin-authentication-local/admin-authentication-local.component.ts @@ -1,11 +1,17 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; import { Strategy } from '../../admin-authentication/admin-settings.model'; +import { AccountLockComponent } from './account-lock/account-lock.component'; +import { PasswordPolicyComponent } from './password-policy/password-policy.component'; @Component({ selector: 'admin-authentication-local', templateUrl: './admin-authentication-local.component.html', styleUrls: ['./admin-authentication-local.component.scss'], - standalone: false + standalone: true, + imports: [ + AccountLockComponent, + PasswordPolicyComponent + ] }) export class AdminAuthenticationLocalComponent { diff --git a/web-app/src/app/admin/admin-authentication/admin-authentication-local/password-policy/password-policy.component.ts b/web-app/src/app/admin/admin-authentication/admin-authentication-local/password-policy/password-policy.component.ts index 49c6a44d6..f40a1f179 100644 --- a/web-app/src/app/admin/admin-authentication/admin-authentication-local/password-policy/password-policy.component.ts +++ b/web-app/src/app/admin/admin-authentication/admin-authentication-local/password-policy/password-policy.component.ts @@ -1,13 +1,28 @@ import { Component, Input, EventEmitter, Output } from '@angular/core'; import { Strategy } from '../../../admin-authentication/admin-settings.model'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { MatIconModule } from '@angular/material/icon'; +import { FormsModule } from '@angular/forms'; @Component({ selector: 'password-policy', templateUrl: 'password-policy.component.html', styleUrls: ['./password-policy.component.scss'], - standalone: false + standalone: true, + imports: [ + FormsModule, + MatSlideToggleModule, + MatIconModule, + MatFormFieldModule, + MatInputModule, + MatTooltipModule + ] }) export class PasswordPolicyComponent { + // No signal needed - strategy is never reassigned @Input() strategy: Strategy; @Output() strategyDirty = new EventEmitter(); diff --git a/web-app/src/app/admin/admin-authentication/admin-authentication-oauth2/admin-authentication-oauth2.component.spec.ts b/web-app/src/app/admin/admin-authentication/admin-authentication-oauth2/admin-authentication-oauth2.component.spec.ts index 883d41e57..ab9e983cc 100644 --- a/web-app/src/app/admin/admin-authentication/admin-authentication-oauth2/admin-authentication-oauth2.component.spec.ts +++ b/web-app/src/app/admin/admin-authentication/admin-authentication-oauth2/admin-authentication-oauth2.component.spec.ts @@ -9,7 +9,7 @@ describe('AdminAuthenticationOAuth2Component', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [AdminAuthenticationOAuth2Component], + imports: [AdminAuthenticationOAuth2Component], schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA] }) .compileComponents(); diff --git a/web-app/src/app/admin/admin-authentication/admin-authentication-oauth2/admin-authentication-oauth2.component.ts b/web-app/src/app/admin/admin-authentication/admin-authentication-oauth2/admin-authentication-oauth2.component.ts index ebaf37d5f..9af5559e6 100644 --- a/web-app/src/app/admin/admin-authentication/admin-authentication-oauth2/admin-authentication-oauth2.component.ts +++ b/web-app/src/app/admin/admin-authentication/admin-authentication-oauth2/admin-authentication-oauth2.component.ts @@ -1,11 +1,23 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { Strategy } from '../../admin-authentication/admin-settings.model'; +import { FormsModule } from '@angular/forms'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; +import { MatExpansionModule } from '@angular/material/expansion'; @Component({ selector: 'admin-authentication-oauth2', templateUrl: './admin-authentication-oauth2.component.html', styleUrls: ['./admin-authentication-oauth2.component.scss'], - standalone: false + standalone: true, + imports: [ + FormsModule, + MatFormFieldModule, + MatInputModule, + MatSlideToggleModule, + MatExpansionModule + ] }) export class AdminAuthenticationOAuth2Component implements OnInit { diff --git a/web-app/src/app/admin/admin-authentication/admin-authentication-oidc/admin-authentication-oidc.component.spec.ts b/web-app/src/app/admin/admin-authentication/admin-authentication-oidc/admin-authentication-oidc.component.spec.ts index a559992cf..131804974 100644 --- a/web-app/src/app/admin/admin-authentication/admin-authentication-oidc/admin-authentication-oidc.component.spec.ts +++ b/web-app/src/app/admin/admin-authentication/admin-authentication-oidc/admin-authentication-oidc.component.spec.ts @@ -9,8 +9,7 @@ describe('AdminAuthenticationOidcComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ AdminAuthenticationOidcComponent ], - imports: [], + imports: [ AdminAuthenticationOidcComponent ], schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA] }) .compileComponents(); diff --git a/web-app/src/app/admin/admin-authentication/admin-authentication-oidc/admin-authentication-oidc.component.ts b/web-app/src/app/admin/admin-authentication/admin-authentication-oidc/admin-authentication-oidc.component.ts index e5ad32df3..f0b536075 100644 --- a/web-app/src/app/admin/admin-authentication/admin-authentication-oidc/admin-authentication-oidc.component.ts +++ b/web-app/src/app/admin/admin-authentication/admin-authentication-oidc/admin-authentication-oidc.component.ts @@ -1,11 +1,21 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { Strategy } from '../../admin-authentication/admin-settings.model'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { FormsModule } from '@angular/forms'; +import { MatInputModule } from '@angular/material/input'; +import { MatExpansionModule } from '@angular/material/expansion'; @Component({ selector: 'admin-authentication-oidc', templateUrl: './admin-authentication-oidc.component.html', styleUrls: ['./admin-authentication-oidc.component.scss'], - standalone: false + standalone: true, + imports: [ + MatFormFieldModule, + FormsModule, + MatInputModule, + MatExpansionModule + ] }) export class AdminAuthenticationOidcComponent implements OnInit { diff --git a/web-app/src/app/admin/admin-authentication/admin-authentication-saml/admin-authentication-saml.component.html b/web-app/src/app/admin/admin-authentication/admin-authentication-saml/admin-authentication-saml.component.html index 4d6e066e4..4efe7a56a 100644 --- a/web-app/src/app/admin/admin-authentication/admin-authentication-saml/admin-authentication-saml.component.html +++ b/web-app/src/app/admin/admin-authentication/admin-authentication-saml/admin-authentication-saml.component.html @@ -49,9 +49,11 @@

Signing

Signature Algorithm - - {{ algorithm.viewValue }} - + @for (algorithm of signatureAlgorithms; track algorithm.value) { + + {{algorithm.viewValue}} + + } Signature algorithm for signing requests. Default: SHA-1. @@ -157,7 +159,11 @@

Additional SAML Parameters

RAC Comparison - {{ rac.viewValue }} + @for (rac of racs; track rac.value) { + + {{rac.viewValue}} + + } Requested Authentication Context comparison type. Default: Exact. diff --git a/web-app/src/app/admin/admin-authentication/admin-authentication-saml/admin-authentication-saml.component.spec.ts b/web-app/src/app/admin/admin-authentication/admin-authentication-saml/admin-authentication-saml.component.spec.ts index a51b2da74..3f094ca4f 100644 --- a/web-app/src/app/admin/admin-authentication/admin-authentication-saml/admin-authentication-saml.component.spec.ts +++ b/web-app/src/app/admin/admin-authentication/admin-authentication-saml/admin-authentication-saml.component.spec.ts @@ -9,7 +9,7 @@ describe('AdminAuthenticationSAMLComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ AdminAuthenticationSAMLComponent ], + imports: [ AdminAuthenticationSAMLComponent ], schemas: [ CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA ] }) .compileComponents(); diff --git a/web-app/src/app/admin/admin-authentication/admin-authentication-saml/admin-authentication-saml.component.ts b/web-app/src/app/admin/admin-authentication/admin-authentication-saml/admin-authentication-saml.component.ts index 8733a06a0..c314bd9de 100644 --- a/web-app/src/app/admin/admin-authentication/admin-authentication-saml/admin-authentication-saml.component.ts +++ b/web-app/src/app/admin/admin-authentication/admin-authentication-saml/admin-authentication-saml.component.ts @@ -1,5 +1,11 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { Strategy } from '../../admin-authentication/admin-settings.model'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { FormsModule } from '@angular/forms'; +import { MatInputModule } from '@angular/material/input'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; +import { MatSelectModule } from '@angular/material/select'; +import { MatExpansionModule } from '@angular/material/expansion'; interface SignatureAlgorithm { value: string; @@ -15,7 +21,15 @@ interface RACComparison { selector: 'admin-authentication-saml', templateUrl: './admin-authentication-saml.component.html', styleUrls: ['./admin-authentication-saml.component.scss'], - standalone: false + standalone: true, + imports: [ + MatFormFieldModule, + FormsModule, + MatInputModule, + MatSlideToggleModule, + MatSelectModule, + MatExpansionModule + ] }) export class AdminAuthenticationSAMLComponent implements OnInit { diff --git a/web-app/src/app/admin/admin.module.ts b/web-app/src/app/admin/admin.module.ts index 96a0add83..f52d4f254 100644 --- a/web-app/src/app/admin/admin.module.ts +++ b/web-app/src/app/admin/admin.module.ts @@ -53,13 +53,12 @@ import { AuthenticationDeleteComponent } from './admin-authentication/admin-auth import { ButtonPreviewComponent } from './admin-authentication/admin-authentication-create/button-preview/button-preview.component'; import { IconUploadComponent } from './admin-authentication/admin-authentication-create/icon-upload/icon-upload.component'; import { AdminAuthenticationOidcComponent } from './admin-authentication/admin-authentication-oidc/admin-authentication-oidc.component'; -import { AdminAuthenticationLocalComponent } from './admin-authentication/admin-authentication-local/admin-authentication-local.component'; import { AdminAuthenticationOAuth2Component } from './admin-authentication/admin-authentication-oauth2/admin-authentication-oauth2.component'; import { AdminAuthenticationLDAPComponent } from './admin-authentication/admin-authentication-ldap/admin-authentication-ldap.component'; import { AdminAuthenticationSAMLComponent } from './admin-authentication/admin-authentication-saml/admin-authentication-saml.component'; +import { AdminAuthenticationLocalComponent } from './admin-authentication/admin-authentication-local/admin-authentication-local.component'; import { PasswordPolicyComponent } from './admin-authentication/admin-authentication-local/password-policy/password-policy.component'; import { AccountLockComponent } from './admin-authentication/admin-authentication-local/account-lock/account-lock.component'; - @NgModule({ imports: [ CommonModule, @@ -99,7 +98,14 @@ import { AccountLockComponent } from './admin-authentication/admin-authenticatio AdminEventFormModule, AdminMapModule, ColorPickerModule, - PluginModule + PluginModule, + AdminAuthenticationLocalComponent, + PasswordPolicyComponent, + AccountLockComponent, + AdminAuthenticationOidcComponent, + AdminAuthenticationOAuth2Component, + AdminAuthenticationLDAPComponent, + AdminAuthenticationSAMLComponent ], declarations: [ SearchModalComponent, @@ -113,13 +119,6 @@ import { AccountLockComponent } from './admin-authentication/admin-authenticatio AuthenticationDeleteComponent, ButtonPreviewComponent, IconUploadComponent, - AdminAuthenticationOidcComponent, - AdminAuthenticationLocalComponent, - AdminAuthenticationOAuth2Component, - AdminAuthenticationLDAPComponent, - AdminAuthenticationSAMLComponent, - PasswordPolicyComponent, - AccountLockComponent ], exports: [AdminComponent], providers: [AdminGuard]