diff --git a/cspell.json b/cspell.json index f86d5fc0dd..01d3cc0fa6 100644 --- a/cspell.json +++ b/cspell.json @@ -139,7 +139,8 @@ "webscript", "Whitespaces", "xdescribe", - "xsrf" + "xsrf", + "BPMECM" ], "dictionaries": [ "html", diff --git a/lib/core/api/src/lib/adf-http-client.service.ts b/lib/core/api/src/lib/adf-http-client.service.ts index 11a288a5be..33aeeaa64e 100644 --- a/lib/core/api/src/lib/adf-http-client.service.ts +++ b/lib/core/api/src/lib/adf-http-client.service.ts @@ -43,8 +43,7 @@ import { AlfrescoApiResponseError } from './alfresco-api/alfresco-api.response-e import { Constructor } from './types'; import { RequestOptions, SecurityOptions } from './interfaces'; import { AppConfigService, AppConfigValues } from '../../../src/lib/app-config/app-config.service'; -import ee from 'event-emitter'; -import { Emitter } from 'event-emitter'; +import ee, { Emitter } from 'event-emitter'; export interface Emitters { readonly eventEmitter: Emitter; diff --git a/lib/core/src/lib/auth/basic-auth/basic-alfresco-auth.service.ts b/lib/core/src/lib/auth/basic-auth/basic-alfresco-auth.service.ts index 06f2d23dc3..bfa6f059a6 100644 --- a/lib/core/src/lib/auth/basic-auth/basic-alfresco-auth.service.ts +++ b/lib/core/src/lib/auth/basic-auth/basic-alfresco-auth.service.ts @@ -1,6 +1,6 @@ /*! * @license - * Copyright 2019 Alfresco Software, Ltd. + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,8 +19,8 @@ import { Injectable } from '@angular/core'; import { AppConfigService, AppConfigValues } from '../../app-config/app-config.service'; import { Authentication } from '../interfaces/authentication.interface'; import { CookieService } from '../../common/services/cookie.service'; -import { ContentAuth } from './contentAuth'; -import { ProcessAuth } from './processAuth'; +import { ContentAuth } from './content-auth'; +import { ProcessAuth } from './process-auth'; import { map } from 'rxjs/operators'; import { from, Observable } from 'rxjs'; import { RedirectionModel } from '../models/redirection.model'; @@ -40,9 +40,9 @@ export class BasicAlfrescoAuthService extends BaseAuthenticationService { authentications: Authentication = { basicAuth: { - ticket: '', + ticket: '' }, - type: 'basic', + type: 'basic' }; constructor( @@ -55,22 +55,22 @@ export class BasicAlfrescoAuthService extends BaseAuthenticationService { super(appConfig, cookie, logService); this.contentAuth.onLogout.pipe(map((event) => { - this.onLogout.next(event) + this.onLogout.next(event); })); this.contentAuth.onLogin.pipe(map((event) => { - this.onLogout.next(event) + this.onLogout.next(event); })); this.contentAuth.onError.pipe(map((event) => { - this.onLogout.next(event) + this.onLogout.next(event); })); this.processAuth.onLogout.pipe(map((event) => { - this.onLogout.next(event) + this.onLogout.next(event); })); this.processAuth.onLogin.pipe(map((event) => { - this.onLogin.next(event) + this.onLogin.next(event); })); this.processAuth.onError.pipe(map((event) => { - this.onError.next(event) + this.onError.next(event); })); } @@ -100,7 +100,7 @@ export class BasicAlfrescoAuthService extends BaseAuthenticationService { * @param username: // Username to login * @param password: // Password to login * - * @returns {Promise} A promise that returns {new authentication ticket} if resolved and {error} if rejected. + * @returns A promise that returns {new authentication ticket} if resolved and {error} if rejected. * */ async executeLogin(username: string, password: string): Promise { if (!this.isCredentialValid(username) || !this.isCredentialValid(password)) { @@ -115,14 +115,12 @@ export class BasicAlfrescoAuthService extends BaseAuthenticationService { try { return await this.processAuth.login(username, password); } catch (e) { - console.log('login BPM error'); } } else if (this.isECMProvider()) { try { return await this.contentAuth.login(username, password); } catch (e) { - console.log('login BPM error'); } } else if (this.isALLProvider()) { @@ -187,7 +185,7 @@ export class BasicAlfrescoAuthService extends BaseAuthenticationService { } getToken(): string { - return ""; + return ''; } isBpmLoggedIn(): boolean { diff --git a/lib/core/src/lib/auth/basic-auth/contentAuth.ts b/lib/core/src/lib/auth/basic-auth/content-auth.ts similarity index 85% rename from lib/core/src/lib/auth/basic-auth/contentAuth.ts rename to lib/core/src/lib/auth/basic-auth/content-auth.ts index 53b42c3bf0..08795e7b81 100644 --- a/lib/core/src/lib/auth/basic-auth/contentAuth.ts +++ b/lib/core/src/lib/auth/basic-auth/content-auth.ts @@ -1,19 +1,19 @@ /*! -* @license -* Copyright 2018 Alfresco Software, Ltd. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ import { Injectable } from '@angular/core'; import { AdfHttpClient } from '@alfresco/adf-core/api'; @@ -52,9 +52,9 @@ export class ContentAuth { authentications: Authentication = { basicAuth: { - ticket: '', + ticket: '' }, - type: 'basic', + type: 'basic' }; get basePath(): string { @@ -126,7 +126,7 @@ export class ContentAuth { /** * logout Alfresco API * - * @returns {Promise} A promise that returns { authentication ticket} if resolved and {error} if rejected. + * @returns A promise that returns { authentication ticket} if resolved and {error} if rejected. * */ logout(): Promise { this.saveUsername(''); @@ -204,16 +204,6 @@ export class ContentAuth { return this.adfHttpClient.post(this.basePath + '/tickets', {bodyParam: ticketBodyCreate}); } - /** - * Delete ticket (logout) - * - * **Note:** this endpoint is available in Alfresco 5.2 and newer versions. - - Deletes logged in ticket (logout). - - * - * @return Promise<{}> - */ deleteTicket(): Promise { return this.adfHttpClient.delete(this.basePath + '/tickets/-me-'); } diff --git a/lib/core/src/lib/auth/basic-auth/processAuth.ts b/lib/core/src/lib/auth/basic-auth/process-auth.ts similarity index 88% rename from lib/core/src/lib/auth/basic-auth/processAuth.ts rename to lib/core/src/lib/auth/basic-auth/process-auth.ts index 783025ee8d..6189530525 100644 --- a/lib/core/src/lib/auth/basic-auth/processAuth.ts +++ b/lib/core/src/lib/auth/basic-auth/process-auth.ts @@ -1,19 +1,20 @@ /*! -* @license -* Copyright 2018 Alfresco Software, Ltd. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * @license + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { Injectable } from '@angular/core'; import { AdfHttpClient } from '@alfresco/adf-core/api'; import { Authentication } from '../interfaces/authentication.interface'; @@ -87,7 +88,7 @@ export class ProcessAuth { submit: 'Login' }, contentType: 'application/x-www-form-urlencoded', - accept: 'application/json', + accept: 'application/json' }; let promise: any = new Promise((resolve, reject) => { @@ -122,8 +123,7 @@ export class ProcessAuth { /** * logout Alfresco API - * - * @returns {Promise} A promise that returns {new authentication ticket} if resolved and {error} if rejected. + * @returns A promise that returns {new authentication ticket} if resolved and {error} if rejected. * */ async logout(): Promise { this.saveUsername(''); diff --git a/lib/core/src/lib/auth/guard/auth-guard-base.ts b/lib/core/src/lib/auth/guard/auth-guard-base.ts index c69fc4c8ed..3b7dcfcc27 100644 --- a/lib/core/src/lib/auth/guard/auth-guard-base.ts +++ b/lib/core/src/lib/auth/guard/auth-guard-base.ts @@ -1,6 +1,6 @@ /*! * @license - * Copyright 2019 Alfresco Software, Ltd. + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/core/src/lib/auth/guard/auth-guard-bpm.service.spec.ts b/lib/core/src/lib/auth/guard/auth-guard-bpm.service.spec.ts index 49dc89028f..5a6bf24872 100644 --- a/lib/core/src/lib/auth/guard/auth-guard-bpm.service.spec.ts +++ b/lib/core/src/lib/auth/guard/auth-guard-bpm.service.spec.ts @@ -24,7 +24,7 @@ import { CoreTestingModule } from '../../testing/core.testing.module'; import { MatDialog } from '@angular/material/dialog'; import { TranslateModule } from '@ngx-translate/core'; import { BasicAlfrescoAuthService } from '../basic-auth/basic-alfresco-auth.service'; -import { OidcAuthenticationService } from '../services/oidc-authentication.service' +import { OidcAuthenticationService } from '../services/oidc-authentication.service'; describe('AuthGuardService BPM', () => { diff --git a/lib/core/src/lib/auth/guard/auth-guard-bpm.service.ts b/lib/core/src/lib/auth/guard/auth-guard-bpm.service.ts index e8578ee9db..59a1a3457b 100644 --- a/lib/core/src/lib/auth/guard/auth-guard-bpm.service.ts +++ b/lib/core/src/lib/auth/guard/auth-guard-bpm.service.ts @@ -1,6 +1,6 @@ /*! * @license - * Copyright 2019 Alfresco Software, Ltd. + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/core/src/lib/auth/guard/auth-guard-ecm.service.ts b/lib/core/src/lib/auth/guard/auth-guard-ecm.service.ts index 8cbff51036..0621b528e1 100644 --- a/lib/core/src/lib/auth/guard/auth-guard-ecm.service.ts +++ b/lib/core/src/lib/auth/guard/auth-guard-ecm.service.ts @@ -1,6 +1,6 @@ /*! * @license - * Copyright 2019 Alfresco Software, Ltd. + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/core/src/lib/auth/guard/auth-guard.service.ts b/lib/core/src/lib/auth/guard/auth-guard.service.ts index 0ba665e0d8..23eb64f47a 100644 --- a/lib/core/src/lib/auth/guard/auth-guard.service.ts +++ b/lib/core/src/lib/auth/guard/auth-guard.service.ts @@ -1,6 +1,6 @@ /*! * @license - * Copyright 2019 Alfresco Software, Ltd. + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/core/src/lib/auth/interfaces/authentication-service.interface.ts b/lib/core/src/lib/auth/interfaces/authentication-service.interface.ts index 7af8b43d3f..a394e81af6 100644 --- a/lib/core/src/lib/auth/interfaces/authentication-service.interface.ts +++ b/lib/core/src/lib/auth/interfaces/authentication-service.interface.ts @@ -1,6 +1,6 @@ /*! * @license - * Copyright 2019 Alfresco Software, Ltd. + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/core/src/lib/auth/interfaces/authentication.interface.ts b/lib/core/src/lib/auth/interfaces/authentication.interface.ts index 649b7f9895..318fa3fe82 100644 --- a/lib/core/src/lib/auth/interfaces/authentication.interface.ts +++ b/lib/core/src/lib/auth/interfaces/authentication.interface.ts @@ -1,6 +1,6 @@ /*! * @license - * Copyright 2019 Alfresco Software, Ltd. + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/core/src/lib/auth/services/authentication.service.ts b/lib/core/src/lib/auth/services/authentication.service.ts index 19389cacdb..f5ae1a68a4 100644 --- a/lib/core/src/lib/auth/services/authentication.service.ts +++ b/lib/core/src/lib/auth/services/authentication.service.ts @@ -1,6 +1,6 @@ /*! * @license - * Copyright 2019 Alfresco Software, Ltd. + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/core/src/lib/auth/services/base-authentication.service.ts b/lib/core/src/lib/auth/services/base-authentication.service.ts index 79fcc46f55..6d79ff6aa3 100644 --- a/lib/core/src/lib/auth/services/base-authentication.service.ts +++ b/lib/core/src/lib/auth/services/base-authentication.service.ts @@ -1,6 +1,6 @@ /*! * @license - * Copyright 2019 Alfresco Software, Ltd. + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -124,7 +124,7 @@ export abstract class BaseAuthenticationService implements AuthenticationServic * @returns Object representing the error message */ handleError(error: any): Observable { - this.onError.next(error || 'Server error') + this.onError.next(error || 'Server error'); this.logService.error('Error when logging in', error); return throwError(error || 'Server error'); } diff --git a/lib/core/src/lib/auth/services/oidc-authentication.service.ts b/lib/core/src/lib/auth/services/oidc-authentication.service.ts index 84308c9c30..99436533ca 100644 --- a/lib/core/src/lib/auth/services/oidc-authentication.service.ts +++ b/lib/core/src/lib/auth/services/oidc-authentication.service.ts @@ -1,6 +1,6 @@ /*! * @license - * Copyright 2019 Alfresco Software, Ltd. + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ export class OidcAuthenticationService extends BaseAuthenticationService { private authStorage: OAuthStorage, private oauthService: OAuthService, private readonly authConfig: AuthConfigService, - private readonly auth: AuthService, + private readonly auth: AuthService ) { super(appConfig, cookie, logService); }