Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: #1537 create an api to return audit information #1587

Merged
merged 42 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
ddfdea7
feat: create audit permission and code tables
craigyu Aug 29, 2024
4d02cb6
fix: grant permissions
craigyu Aug 29, 2024
e1bbb00
Merge branch 'main' into feat/1536-create-the-new-audit-tables
craigyu Aug 30, 2024
a979679
fix: Merge branch 'main' into feat/1537-create-an-api-to-return-audit…
craigyu Sep 5, 2024
b4e1904
feat: add new models def
craigyu Sep 5, 2024
68eae76
fix: depreciated utcnow
craigyu Sep 5, 2024
61a02b4
Merge branch 'main' into feat/1537-create-an-api-to-return-audit-info…
craigyu Sep 6, 2024
633b4e2
feat: add schemas
craigyu Sep 6, 2024
b1554d5
fix: magic number
craigyu Sep 6, 2024
89e1e55
fix: model relationship
craigyu Sep 6, 2024
9116670
fix: remove district related code
craigyu Sep 10, 2024
7117ecd
use JSONB
craigyu Sep 10, 2024
fa22fd5
fix: use enum
craigyu Sep 10, 2024
115af42
fix: table args
craigyu Sep 10, 2024
d4077f0
fix: mapped columns
craigyu Sep 10, 2024
4d17a31
fix: naming and comments
craigyu Sep 10, 2024
47df43e
fix: file name
craigyu Sep 10, 2024
c91098d
fix: endpoint template
craigyu Sep 10, 2024
1a06216
fix: stash changes
craigyu Sep 10, 2024
8c84367
feat: endpoint complete
craigyu Sep 11, 2024
298472d
fix: add tests
craigyu Sep 11, 2024
8bd2270
fix: datetime
craigyu Sep 11, 2024
9bd001a
fix: test data
craigyu Sep 11, 2024
72dfa31
fix: tests and fixture
craigyu Sep 11, 2024
21d9854
fix: test
craigyu Sep 11, 2024
357023d
fix: router tests
craigyu Sep 11, 2024
b02300d
fix: tests
craigyu Sep 11, 2024
d6ce4a6
fix: tests
craigyu Sep 11, 2024
131279c
fix: tests
craigyu Sep 12, 2024
95e6830
feat: client-code-gen
craigyu Sep 12, 2024
9025a75
Revert "feat: client-code-gen"
craigyu Sep 12, 2024
999b602
feat: client-code-gen
craigyu Sep 12, 2024
7a8741c
fix: frontend schema update
craigyu Sep 12, 2024
78404e1
fix: dependency location
craigyu Sep 13, 2024
fbecc2d
fix: remove unused import
craigyu Sep 13, 2024
c3ce32c
fix: simplify comment and use model_config
craigyu Sep 13, 2024
1b63d6a
Merge branch 'main' into feat/1537-create-an-api-to-return-audit-info…
craigyu Sep 13, 2024
e7b1133
fix: rename class
craigyu Sep 13, 2024
15c3eec
fix: add id
craigyu Sep 13, 2024
2a26519
fix: tests
craigyu Sep 13, 2024
1e675f2
fix: return
craigyu Sep 13, 2024
b8e3086
fix: get_db admin
craigyu Sep 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,592 changes: 1,591 additions & 1 deletion client-code-gen/app-access-control-openapi.json

Large diffs are not rendered by default.

36 changes: 22 additions & 14 deletions client-code-gen/gen/app-access-control-api/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,39 @@ api/famuser-api.ts
api/famuser-role-assignment-api.ts
api/famuser-terms-and-conditions-api.ts
api/idirbce-idproxy-api.ts
api/permission-audit-api.ts
api/smoke-test-api.ts
base.ts
common.ts
configuration.ts
git_push.sh
index.ts
model/email-sending-status.ts
model/fam-application-user-role-assignment-get.ts
model/fam-application.ts
model/fam-application-schema.ts
model/fam-application-user-role-assignment-get-schema.ts
model/fam-forest-client-schema.ts
model/fam-forest-client-status-schema.ts
model/fam-forest-client-status-type.ts
model/fam-forest-client-status.ts
model/fam-forest-client.ts
model/fam-role-min.ts
model/fam-role-with-client.ts
model/fam-user-info.ts
model/fam-user-role-assignment-create-response.ts
model/fam-user-role-assignment-create.ts
model/fam-user-role-assignment-response.ts
model/fam-user-type.ts
model/fam-user-update-response.ts
model/fam-role-min-schema.ts
model/fam-role-with-client-schema.ts
model/fam-user-info-schema.ts
model/fam-user-role-assignment-create-response-schema.ts
model/fam-user-role-assignment-create-schema.ts
model/fam-user-role-assignment-response-schema.ts
model/fam-user-type-schema.ts
model/fam-user-update-response-schema.ts
model/httpvalidation-error.ts
model/idim-proxy-bceid-info.ts
model/idim-proxy-idir-info.ts
model/idim-proxy-bceid-info-schema.ts
model/idim-proxy-idir-info-schema.ts
model/index.ts
model/location-inner.ts
model/permission-audit-history-res-dto.ts
model/privilege-change-performer-schema.ts
model/privilege-details-permission-type-enum.ts
model/privilege-details-role-schema.ts
model/privilege-details-schema.ts
model/privilege-details-scope-schema.ts
model/privilege-details-scope-type-enum.ts
model/role-type.ts
model/user-type.ts
model/validation-error.ts
Expand Down
3 changes: 2 additions & 1 deletion client-code-gen/gen/app-access-control-api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint-disable */
/**
* Forest Access Management - FAM - API
* Forest Access Management API used by the Forest Access Management application to Define who has access to what apps, and what roles they will operate under once access is granted.
* Forest Access Management API used by the Forest Access Management application to Define who has access to what apps, and what roles they will operate under once access is granted.
*
* The version of the OpenAPI document: 0.0.1
* Contact: [email protected]
Expand All @@ -21,5 +21,6 @@ export * from './api/famuser-api';
export * from './api/famuser-role-assignment-api';
export * from './api/famuser-terms-and-conditions-api';
export * from './api/idirbce-idproxy-api';
export * from './api/permission-audit-api';
export * from './api/smoke-test-api';

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObj
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
// @ts-ignore
import { FamApplicationUserRoleAssignmentGet } from '../model';
import { FamApplicationUserRoleAssignmentGetSchema } from '../model';
// @ts-ignore
import { HTTPValidationError } from '../model';
/**
Expand Down Expand Up @@ -86,7 +86,7 @@ export const FAMApplicationsApiFp = function(configuration?: Configuration) {
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getFamApplicationUserRoleAssignment(applicationId: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<FamApplicationUserRoleAssignmentGet>>> {
async getFamApplicationUserRoleAssignment(applicationId: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<FamApplicationUserRoleAssignmentGetSchema>>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getFamApplicationUserRoleAssignment(applicationId, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['FAMApplicationsApi.getFamApplicationUserRoleAssignment']?.[localVarOperationServerIndex]?.url;
Expand All @@ -109,7 +109,7 @@ export const FAMApplicationsApiFactory = function (configuration?: Configuration
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getFamApplicationUserRoleAssignment(applicationId: number, options?: any): AxiosPromise<Array<FamApplicationUserRoleAssignmentGet>> {
getFamApplicationUserRoleAssignment(applicationId: number, options?: any): AxiosPromise<Array<FamApplicationUserRoleAssignmentGetSchema>> {
return localVarFp.getFamApplicationUserRoleAssignment(applicationId, options).then((request) => request(axios, basePath));
},
};
Expand All @@ -129,7 +129,7 @@ export interface FAMApplicationsApiInterface {
* @throws {RequiredError}
* @memberof FAMApplicationsApiInterface
*/
getFamApplicationUserRoleAssignment(applicationId: number, options?: RawAxiosRequestConfig): AxiosPromise<Array<FamApplicationUserRoleAssignmentGet>>;
getFamApplicationUserRoleAssignment(applicationId: number, options?: RawAxiosRequestConfig): AxiosPromise<Array<FamApplicationUserRoleAssignmentGetSchema>>;

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObj
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
// @ts-ignore
import { FamForestClient } from '../model';
import { FamForestClientSchema } from '../model';
// @ts-ignore
import { HTTPValidationError } from '../model';
/**
Expand Down Expand Up @@ -97,7 +97,7 @@ export const FAMForestClientsApiFp = function(configuration?: Configuration) {
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async search(clientNumber: string, applicationId: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<FamForestClient>>> {
async search(clientNumber: string, applicationId: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<FamForestClientSchema>>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.search(clientNumber, applicationId, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['FAMForestClientsApi.search']?.[localVarOperationServerIndex]?.url;
Expand All @@ -121,7 +121,7 @@ export const FAMForestClientsApiFactory = function (configuration?: Configuratio
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
search(clientNumber: string, applicationId: number, options?: any): AxiosPromise<Array<FamForestClient>> {
search(clientNumber: string, applicationId: number, options?: any): AxiosPromise<Array<FamForestClientSchema>> {
return localVarFp.search(clientNumber, applicationId, options).then((request) => request(axios, basePath));
},
};
Expand All @@ -142,7 +142,7 @@ export interface FAMForestClientsApiInterface {
* @throws {RequiredError}
* @memberof FAMForestClientsApiInterface
*/
search(clientNumber: string, applicationId: number, options?: RawAxiosRequestConfig): AxiosPromise<Array<FamForestClient>>;
search(clientNumber: string, applicationId: number, options?: RawAxiosRequestConfig): AxiosPromise<Array<FamForestClientSchema>>;

}

Expand Down
8 changes: 4 additions & 4 deletions client-code-gen/gen/app-access-control-api/api/famuser-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObj
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
// @ts-ignore
import { FamUserUpdateResponse } from '../model';
import { FamUserUpdateResponseSchema } from '../model';
// @ts-ignore
import { HTTPValidationError } from '../model';
/**
Expand Down Expand Up @@ -98,7 +98,7 @@ export const FAMUserApiFp = function(configuration?: Configuration) {
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async updateUserInformationFromIdimSource(page?: number, perPage?: number, usePagination?: boolean, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FamUserUpdateResponse>> {
async updateUserInformationFromIdimSource(page?: number, perPage?: number, usePagination?: boolean, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FamUserUpdateResponseSchema>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.updateUserInformationFromIdimSource(page, perPage, usePagination, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['FAMUserApi.updateUserInformationFromIdimSource']?.[localVarOperationServerIndex]?.url;
Expand All @@ -123,7 +123,7 @@ export const FAMUserApiFactory = function (configuration?: Configuration, basePa
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateUserInformationFromIdimSource(page?: number, perPage?: number, usePagination?: boolean, options?: any): AxiosPromise<FamUserUpdateResponse> {
updateUserInformationFromIdimSource(page?: number, perPage?: number, usePagination?: boolean, options?: any): AxiosPromise<FamUserUpdateResponseSchema> {
return localVarFp.updateUserInformationFromIdimSource(page, perPage, usePagination, options).then((request) => request(axios, basePath));
},
};
Expand All @@ -145,7 +145,7 @@ export interface FAMUserApiInterface {
* @throws {RequiredError}
* @memberof FAMUserApiInterface
*/
updateUserInformationFromIdimSource(page?: number, perPage?: number, usePagination?: boolean, options?: RawAxiosRequestConfig): AxiosPromise<FamUserUpdateResponse>;
updateUserInformationFromIdimSource(page?: number, perPage?: number, usePagination?: boolean, options?: RawAxiosRequestConfig): AxiosPromise<FamUserUpdateResponseSchema>;

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObj
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
// @ts-ignore
import { FamUserRoleAssignmentCreate } from '../model';
import { FamUserRoleAssignmentCreateSchema } from '../model';
// @ts-ignore
import { FamUserRoleAssignmentResponse } from '../model';
import { FamUserRoleAssignmentResponseSchema } from '../model';
// @ts-ignore
import { HTTPValidationError } from '../model';
/**
Expand All @@ -36,13 +36,13 @@ export const FAMUserRoleAssignmentApiAxiosParamCreator = function (configuration
/**
* Grant User Access to an application\'s role.
* @summary Create User Role Assignment Many
* @param {FamUserRoleAssignmentCreate} famUserRoleAssignmentCreate
* @param {FamUserRoleAssignmentCreateSchema} famUserRoleAssignmentCreateSchema
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createUserRoleAssignmentMany: async (famUserRoleAssignmentCreate: FamUserRoleAssignmentCreate, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'famUserRoleAssignmentCreate' is not null or undefined
assertParamExists('createUserRoleAssignmentMany', 'famUserRoleAssignmentCreate', famUserRoleAssignmentCreate)
createUserRoleAssignmentMany: async (famUserRoleAssignmentCreateSchema: FamUserRoleAssignmentCreateSchema, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'famUserRoleAssignmentCreateSchema' is not null or undefined
assertParamExists('createUserRoleAssignmentMany', 'famUserRoleAssignmentCreateSchema', famUserRoleAssignmentCreateSchema)
const localVarPath = `/user_role_assignment`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
Expand All @@ -66,7 +66,7 @@ export const FAMUserRoleAssignmentApiAxiosParamCreator = function (configuration
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(famUserRoleAssignmentCreate, localVarRequestOptions, configuration)
localVarRequestOptions.data = serializeDataIfNeeded(famUserRoleAssignmentCreateSchema, localVarRequestOptions, configuration)

return {
url: toPathString(localVarUrlObj),
Expand Down Expand Up @@ -124,12 +124,12 @@ export const FAMUserRoleAssignmentApiFp = function(configuration?: Configuration
/**
* Grant User Access to an application\'s role.
* @summary Create User Role Assignment Many
* @param {FamUserRoleAssignmentCreate} famUserRoleAssignmentCreate
* @param {FamUserRoleAssignmentCreateSchema} famUserRoleAssignmentCreateSchema
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async createUserRoleAssignmentMany(famUserRoleAssignmentCreate: FamUserRoleAssignmentCreate, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FamUserRoleAssignmentResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.createUserRoleAssignmentMany(famUserRoleAssignmentCreate, options);
async createUserRoleAssignmentMany(famUserRoleAssignmentCreateSchema: FamUserRoleAssignmentCreateSchema, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FamUserRoleAssignmentResponseSchema>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.createUserRoleAssignmentMany(famUserRoleAssignmentCreateSchema, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['FAMUserRoleAssignmentApi.createUserRoleAssignmentMany']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
Expand Down Expand Up @@ -160,12 +160,12 @@ export const FAMUserRoleAssignmentApiFactory = function (configuration?: Configu
/**
* Grant User Access to an application\'s role.
* @summary Create User Role Assignment Many
* @param {FamUserRoleAssignmentCreate} famUserRoleAssignmentCreate
* @param {FamUserRoleAssignmentCreateSchema} famUserRoleAssignmentCreateSchema
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createUserRoleAssignmentMany(famUserRoleAssignmentCreate: FamUserRoleAssignmentCreate, options?: any): AxiosPromise<FamUserRoleAssignmentResponse> {
return localVarFp.createUserRoleAssignmentMany(famUserRoleAssignmentCreate, options).then((request) => request(axios, basePath));
createUserRoleAssignmentMany(famUserRoleAssignmentCreateSchema: FamUserRoleAssignmentCreateSchema, options?: any): AxiosPromise<FamUserRoleAssignmentResponseSchema> {
return localVarFp.createUserRoleAssignmentMany(famUserRoleAssignmentCreateSchema, options).then((request) => request(axios, basePath));
},
/**
* Remove a specific application\'s role from user\'s access.
Expand All @@ -189,12 +189,12 @@ export interface FAMUserRoleAssignmentApiInterface {
/**
* Grant User Access to an application\'s role.
* @summary Create User Role Assignment Many
* @param {FamUserRoleAssignmentCreate} famUserRoleAssignmentCreate
* @param {FamUserRoleAssignmentCreateSchema} famUserRoleAssignmentCreateSchema
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FAMUserRoleAssignmentApiInterface
*/
createUserRoleAssignmentMany(famUserRoleAssignmentCreate: FamUserRoleAssignmentCreate, options?: RawAxiosRequestConfig): AxiosPromise<FamUserRoleAssignmentResponse>;
createUserRoleAssignmentMany(famUserRoleAssignmentCreateSchema: FamUserRoleAssignmentCreateSchema, options?: RawAxiosRequestConfig): AxiosPromise<FamUserRoleAssignmentResponseSchema>;

/**
* Remove a specific application\'s role from user\'s access.
Expand All @@ -218,13 +218,13 @@ export class FAMUserRoleAssignmentApi extends BaseAPI implements FAMUserRoleAssi
/**
* Grant User Access to an application\'s role.
* @summary Create User Role Assignment Many
* @param {FamUserRoleAssignmentCreate} famUserRoleAssignmentCreate
* @param {FamUserRoleAssignmentCreateSchema} famUserRoleAssignmentCreateSchema
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FAMUserRoleAssignmentApi
*/
public createUserRoleAssignmentMany(famUserRoleAssignmentCreate: FamUserRoleAssignmentCreate, options?: RawAxiosRequestConfig) {
return FAMUserRoleAssignmentApiFp(this.configuration).createUserRoleAssignmentMany(famUserRoleAssignmentCreate, options).then((request) => request(this.axios, this.basePath));
public createUserRoleAssignmentMany(famUserRoleAssignmentCreateSchema: FamUserRoleAssignmentCreateSchema, options?: RawAxiosRequestConfig) {
return FAMUserRoleAssignmentApiFp(this.configuration).createUserRoleAssignmentMany(famUserRoleAssignmentCreateSchema, options).then((request) => request(this.axios, this.basePath));
}

/**
Expand Down
Loading
Loading