[AAE-12511] implement OIDC authentication capabilities in ADF (#7856)

* feat: add custom AlfrescoApiHttpClient [ci:force]

* feat: update configs

* feat: move api to follow second entry point structure

* feat: add auth module [ci:force]

* Fix rebasing issues

* Isolate oidc package as subfolder

* Canary mode

* [AAE-12498] Fix unit test should load external settings: resolve reponse data instead returning default config

* [AAE-12498] Set @nrwl/eslint-plugin-nx@14.5.4 version to fix lint job that failed because of the 14.8.6 version (https://github.com/Alfresco/alfresco-ng2-components/actions/runs/4165060892/jobs/7207651856\#step:5:3379)

* [AAE-12498] Fix stories:build-storybook:ci issues

* [AAE-7991] cherry-pick e935f7b0b1 from repo https://github.com/Alfresco/alfresco-ng2-components/pull/7818: send onLogin to initialize acs version to fix [C362242] on canary configuration

* [AAE-12498] Fix security hotspot: fix unsafe pseudorandom number generator

* test: add missing tests for oidc-auth.guard

* test: fix lint issues

* chore: remove assignment in return

* [AAE-12498] Remove warning comment because we already know we're doing breaking changes

* [AAE-12498] Add auth-config.service unit tests

* [AAE-12498] Remove getUserProfile from auth service

---------

Co-authored-by: Andras Popovics <popovics@ndras.hu>
Co-authored-by: Amedeo Lepore <amedeo.lepore@hyland.com>
This commit is contained in:
Mikołaj Serwicki
2023-03-07 09:53:11 +01:00
committed by GitHub
parent dd91f2eeb6
commit f4a8084f0c
62 changed files with 15034 additions and 17744 deletions

3
lib/core/api/README.md Normal file
View File

@@ -0,0 +1,3 @@
# @alfresco/adf-core/api
Secondary entry point of `@alfresco/adf-core`. It can be used by importing from `@alfresco/adf-core/api`.

View File

@@ -1,6 +1,5 @@
{
"$schema": "../../../../../node_modules/ng-packagr/ng-package.schema.json",
"lib": {
"entryFile": "public-api.ts"
"entryFile": "src/index.ts"
}
}

View File

@@ -1,22 +0,0 @@
/*!
* @license
* Copyright 2019 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.
*/
export * from './api-client.factory';
export * from './api-clients.service';
export * from './clients';
export * from './types';
export * from './alfresco-api/alfresco-api.http-client';

View File

@@ -15,5 +15,8 @@
* limitations under the License.
*/
export * from './public-api';
export * from './lib/api-client.factory';
export * from './lib/api-clients.service';
export * from './lib/clients';
export * from './lib/types';
export * from './lib/alfresco-api/alfresco-api.http-client';

View File

@@ -181,6 +181,9 @@ describe('AlfrescoApiHttpClient', () => {
const req = controller.expectOne('http://example.com?autoRename=true&include=allowableOperations');
expect(req.request.method).toEqual('POST');
// filedata: (binary)
// include: allowableOperations
const body = req.request.body as HttpParams;
expect(body.get('relativePath')).toBe('');

View File

@@ -15,6 +15,7 @@
* limitations under the License.
*/
import { HttpClientModule, HttpClientXsrfModule } from '@angular/common/http';
import { NgModule } from '@angular/core';
import { ApiClientsService } from '../api-clients.service';
import { ActivitiClientModule } from './activiti/activiti-client.module';
@@ -22,6 +23,11 @@ import { DiscoveryClientModule } from './discovery/discovery-client.module';
@NgModule({
imports: [
HttpClientModule,
HttpClientXsrfModule.withOptions({
cookieName: 'CSRF-TOKEN',
headerName: 'X-CSRF-TOKEN'
}),
ActivitiClientModule,
DiscoveryClientModule
],

View File

@@ -18,4 +18,3 @@
export * from './activiti/activiti-client.types';
export * from './alfresco-js-clients.module';
export * from './discovery/discovery-client.types';