mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
fix lint
This commit is contained in:
@@ -139,7 +139,8 @@
|
|||||||
"webscript",
|
"webscript",
|
||||||
"Whitespaces",
|
"Whitespaces",
|
||||||
"xdescribe",
|
"xdescribe",
|
||||||
"xsrf"
|
"xsrf",
|
||||||
|
"BPMECM"
|
||||||
],
|
],
|
||||||
"dictionaries": [
|
"dictionaries": [
|
||||||
"html",
|
"html",
|
||||||
|
@@ -43,8 +43,7 @@ import { AlfrescoApiResponseError } from './alfresco-api/alfresco-api.response-e
|
|||||||
import { Constructor } from './types';
|
import { Constructor } from './types';
|
||||||
import { RequestOptions, SecurityOptions } from './interfaces';
|
import { RequestOptions, SecurityOptions } from './interfaces';
|
||||||
import { AppConfigService, AppConfigValues } from '../../../src/lib/app-config/app-config.service';
|
import { AppConfigService, AppConfigValues } from '../../../src/lib/app-config/app-config.service';
|
||||||
import ee from 'event-emitter';
|
import ee, { Emitter } from 'event-emitter';
|
||||||
import { Emitter } from 'event-emitter';
|
|
||||||
|
|
||||||
export interface Emitters {
|
export interface Emitters {
|
||||||
readonly eventEmitter: Emitter;
|
readonly eventEmitter: Emitter;
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
* @license
|
* @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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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 { AppConfigService, AppConfigValues } from '../../app-config/app-config.service';
|
||||||
import { Authentication } from '../interfaces/authentication.interface';
|
import { Authentication } from '../interfaces/authentication.interface';
|
||||||
import { CookieService } from '../../common/services/cookie.service';
|
import { CookieService } from '../../common/services/cookie.service';
|
||||||
import { ContentAuth } from './contentAuth';
|
import { ContentAuth } from './content-auth';
|
||||||
import { ProcessAuth } from './processAuth';
|
import { ProcessAuth } from './process-auth';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
import { from, Observable } from 'rxjs';
|
import { from, Observable } from 'rxjs';
|
||||||
import { RedirectionModel } from '../models/redirection.model';
|
import { RedirectionModel } from '../models/redirection.model';
|
||||||
@@ -40,9 +40,9 @@ export class BasicAlfrescoAuthService extends BaseAuthenticationService {
|
|||||||
|
|
||||||
authentications: Authentication = {
|
authentications: Authentication = {
|
||||||
basicAuth: {
|
basicAuth: {
|
||||||
ticket: '',
|
ticket: ''
|
||||||
},
|
},
|
||||||
type: 'basic',
|
type: 'basic'
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@@ -55,22 +55,22 @@ export class BasicAlfrescoAuthService extends BaseAuthenticationService {
|
|||||||
super(appConfig, cookie, logService);
|
super(appConfig, cookie, logService);
|
||||||
|
|
||||||
this.contentAuth.onLogout.pipe(map((event) => {
|
this.contentAuth.onLogout.pipe(map((event) => {
|
||||||
this.onLogout.next(event)
|
this.onLogout.next(event);
|
||||||
}));
|
}));
|
||||||
this.contentAuth.onLogin.pipe(map((event) => {
|
this.contentAuth.onLogin.pipe(map((event) => {
|
||||||
this.onLogout.next(event)
|
this.onLogout.next(event);
|
||||||
}));
|
}));
|
||||||
this.contentAuth.onError.pipe(map((event) => {
|
this.contentAuth.onError.pipe(map((event) => {
|
||||||
this.onLogout.next(event)
|
this.onLogout.next(event);
|
||||||
}));
|
}));
|
||||||
this.processAuth.onLogout.pipe(map((event) => {
|
this.processAuth.onLogout.pipe(map((event) => {
|
||||||
this.onLogout.next(event)
|
this.onLogout.next(event);
|
||||||
}));
|
}));
|
||||||
this.processAuth.onLogin.pipe(map((event) => {
|
this.processAuth.onLogin.pipe(map((event) => {
|
||||||
this.onLogin.next(event)
|
this.onLogin.next(event);
|
||||||
}));
|
}));
|
||||||
this.processAuth.onError.pipe(map((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 username: // Username to login
|
||||||
* @param password: // Password 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<any> {
|
async executeLogin(username: string, password: string): Promise<any> {
|
||||||
if (!this.isCredentialValid(username) || !this.isCredentialValid(password)) {
|
if (!this.isCredentialValid(username) || !this.isCredentialValid(password)) {
|
||||||
@@ -115,14 +115,12 @@ export class BasicAlfrescoAuthService extends BaseAuthenticationService {
|
|||||||
try {
|
try {
|
||||||
return await this.processAuth.login(username, password);
|
return await this.processAuth.login(username, password);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log('login BPM error');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (this.isECMProvider()) {
|
} else if (this.isECMProvider()) {
|
||||||
try {
|
try {
|
||||||
return await this.contentAuth.login(username, password);
|
return await this.contentAuth.login(username, password);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log('login BPM error');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (this.isALLProvider()) {
|
} else if (this.isALLProvider()) {
|
||||||
@@ -187,7 +185,7 @@ export class BasicAlfrescoAuthService extends BaseAuthenticationService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getToken(): string {
|
getToken(): string {
|
||||||
return "";
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
isBpmLoggedIn(): boolean {
|
isBpmLoggedIn(): boolean {
|
||||||
|
@@ -1,19 +1,19 @@
|
|||||||
/*!
|
/*!
|
||||||
* @license
|
* @license
|
||||||
* Copyright 2018 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { AdfHttpClient } from '@alfresco/adf-core/api';
|
import { AdfHttpClient } from '@alfresco/adf-core/api';
|
||||||
@@ -52,9 +52,9 @@ export class ContentAuth {
|
|||||||
|
|
||||||
authentications: Authentication = {
|
authentications: Authentication = {
|
||||||
basicAuth: {
|
basicAuth: {
|
||||||
ticket: '',
|
ticket: ''
|
||||||
},
|
},
|
||||||
type: 'basic',
|
type: 'basic'
|
||||||
};
|
};
|
||||||
|
|
||||||
get basePath(): string {
|
get basePath(): string {
|
||||||
@@ -126,7 +126,7 @@ export class ContentAuth {
|
|||||||
/**
|
/**
|
||||||
* logout Alfresco API
|
* 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<any> {
|
logout(): Promise<any> {
|
||||||
this.saveUsername('');
|
this.saveUsername('');
|
||||||
@@ -204,16 +204,6 @@ export class ContentAuth {
|
|||||||
return this.adfHttpClient.post(this.basePath + '/tickets', {bodyParam: ticketBodyCreate});
|
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<any> {
|
deleteTicket(): Promise<any> {
|
||||||
return this.adfHttpClient.delete(this.basePath + '/tickets/-me-');
|
return this.adfHttpClient.delete(this.basePath + '/tickets/-me-');
|
||||||
}
|
}
|
@@ -1,19 +1,20 @@
|
|||||||
/*!
|
/*!
|
||||||
* @license
|
* @license
|
||||||
* Copyright 2018 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { AdfHttpClient } from '@alfresco/adf-core/api';
|
import { AdfHttpClient } from '@alfresco/adf-core/api';
|
||||||
import { Authentication } from '../interfaces/authentication.interface';
|
import { Authentication } from '../interfaces/authentication.interface';
|
||||||
@@ -87,7 +88,7 @@ export class ProcessAuth {
|
|||||||
submit: 'Login'
|
submit: 'Login'
|
||||||
},
|
},
|
||||||
contentType: 'application/x-www-form-urlencoded',
|
contentType: 'application/x-www-form-urlencoded',
|
||||||
accept: 'application/json',
|
accept: 'application/json'
|
||||||
};
|
};
|
||||||
|
|
||||||
let promise: any = new Promise((resolve, reject) => {
|
let promise: any = new Promise((resolve, reject) => {
|
||||||
@@ -122,8 +123,7 @@ export class ProcessAuth {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* logout Alfresco API
|
* logout Alfresco API
|
||||||
*
|
* @returns A promise that returns {new authentication ticket} if resolved and {error} if rejected.
|
||||||
* @returns {Promise} A promise that returns {new authentication ticket} if resolved and {error} if rejected.
|
|
||||||
* */
|
* */
|
||||||
async logout(): Promise<any> {
|
async logout(): Promise<any> {
|
||||||
this.saveUsername('');
|
this.saveUsername('');
|
@@ -1,6 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
* @license
|
* @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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@@ -24,7 +24,7 @@ import { CoreTestingModule } from '../../testing/core.testing.module';
|
|||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { BasicAlfrescoAuthService } from '../basic-auth/basic-alfresco-auth.service';
|
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', () => {
|
describe('AuthGuardService BPM', () => {
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
* @license
|
* @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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
* @license
|
* @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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
* @license
|
* @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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
* @license
|
* @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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
* @license
|
* @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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
* @license
|
* @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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
* @license
|
* @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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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
|
* @returns Object representing the error message
|
||||||
*/
|
*/
|
||||||
handleError(error: any): Observable<any> {
|
handleError(error: any): Observable<any> {
|
||||||
this.onError.next(error || 'Server error')
|
this.onError.next(error || 'Server error');
|
||||||
this.logService.error('Error when logging in', error);
|
this.logService.error('Error when logging in', error);
|
||||||
return throwError(error || 'Server error');
|
return throwError(error || 'Server error');
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
* @license
|
* @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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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 authStorage: OAuthStorage,
|
||||||
private oauthService: OAuthService,
|
private oauthService: OAuthService,
|
||||||
private readonly authConfig: AuthConfigService,
|
private readonly authConfig: AuthConfigService,
|
||||||
private readonly auth: AuthService,
|
private readonly auth: AuthService
|
||||||
) {
|
) {
|
||||||
super(appConfig, cookie, logService);
|
super(appConfig, cookie, logService);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user