Revert "API: Add Compliance API slice"
This reverts commit 36f9e70565.
The Compliance v1 API is not stable and not intended for consumption by
other teams. We will implement the OpenSCAP MVP without the Compliance
API for now with a hard coded list of polices in image-builder, and when
their v2 API is ready in the near future begin using it to retrieve
policies.
This commit is contained in:
parent
12d920f9b3
commit
67570b8e54
8 changed files with 0 additions and 65 deletions
|
|
@ -1,6 +1,5 @@
|
|||
# Ignore programatically generated API slices
|
||||
imageBuilderApi.ts
|
||||
complianceApi.ts
|
||||
contentSourcesApi.ts
|
||||
rhsmApi.ts
|
||||
provisioningApi.ts
|
||||
|
|
|
|||
1
api.sh
1
api.sh
|
|
@ -6,7 +6,6 @@ npx @rtk-query/codegen-openapi ./api/config/rhsm.ts &
|
|||
npx @rtk-query/codegen-openapi ./api/config/contentSources.ts &
|
||||
npx @rtk-query/codegen-openapi ./api/config/provisioning.ts &
|
||||
npx @rtk-query/codegen-openapi ./api/config/edge.ts &
|
||||
npx @rtk-query/codegen-openapi ./api/config/compliance.ts &
|
||||
|
||||
# Wait for all background jobs to finish
|
||||
wait
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
import type { ConfigFile } from '@rtk-query/codegen-openapi';
|
||||
|
||||
const config: ConfigFile = {
|
||||
schemaFile: '../schema/compliance.json',
|
||||
apiFile: '../../src/store/emptyComplianceApi.ts',
|
||||
apiImport: 'emptyComplianceApi',
|
||||
outputFile: '../../src/store/complianceApi.ts',
|
||||
exportName: 'complianceApi',
|
||||
hooks: true,
|
||||
filterEndpoints: ['listProfiles'],
|
||||
};
|
||||
|
||||
export default config;
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,3 @@
|
|||
export const COMPLIANCE_API = '/api/compliance/v1';
|
||||
export const IMAGE_BUILDER_API = '/api/image-builder/v1';
|
||||
export const RHSM_API = '/api/rhsm/v2';
|
||||
export const EDGE_API = '/api/edge/v1';
|
||||
|
|
|
|||
|
|
@ -1,35 +0,0 @@
|
|||
import { emptyComplianceApi as api } from "./emptyComplianceApi";
|
||||
const injectedRtkApi = api.injectEndpoints({
|
||||
endpoints: (build) => ({
|
||||
listProfiles: build.query<ListProfilesApiResponse, ListProfilesApiArg>({
|
||||
query: (queryArg) => ({
|
||||
url: `/profiles`,
|
||||
headers: { "X-RH-IDENTITY": queryArg["X-RH-IDENTITY"] },
|
||||
params: {
|
||||
limit: queryArg.limit,
|
||||
offset: queryArg.offset,
|
||||
search: queryArg.search,
|
||||
sort_by: queryArg.sortBy,
|
||||
include: queryArg.include,
|
||||
},
|
||||
}),
|
||||
}),
|
||||
}),
|
||||
overrideExisting: false,
|
||||
});
|
||||
export { injectedRtkApi as complianceApi };
|
||||
export type ListProfilesApiResponse = unknown;
|
||||
export type ListProfilesApiArg = {
|
||||
"X-RH-IDENTITY"?: string;
|
||||
/** The number of items to return */
|
||||
limit?: number;
|
||||
/** The number of items to skip before starting to collect the result set */
|
||||
offset?: number;
|
||||
/** Query string compliant with scoped_search query language: https://github.com/wvanbergen/scoped_search/wiki/Query-language */
|
||||
search?: string;
|
||||
/** A string or an array of fields with an optional direction (:asc or :desc) to sort the results. */
|
||||
sortBy?: string[] | string;
|
||||
/** A comma seperated list of resources to include in the response */
|
||||
include?: string;
|
||||
};
|
||||
export const { useListProfilesQuery } = injectedRtkApi;
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react';
|
||||
|
||||
import { COMPLIANCE_API } from '../constants';
|
||||
|
||||
// initialize an empty api service that we'll inject endpoints into later as needed
|
||||
export const emptyComplianceApi = createApi({
|
||||
reducerPath: 'complianceApi',
|
||||
baseQuery: fetchBaseQuery({ baseUrl: COMPLIANCE_API }),
|
||||
endpoints: () => ({}),
|
||||
});
|
||||
|
|
@ -3,7 +3,6 @@ import { configureStore } from '@reduxjs/toolkit';
|
|||
import promiseMiddleware from 'redux-promise-middleware';
|
||||
|
||||
import clonesSlice from './clonesSlice';
|
||||
import { complianceApi } from './complianceApi';
|
||||
import composesSlice from './composesSlice';
|
||||
import { contentSourcesApi } from './contentSourcesApi';
|
||||
import { edgeApi } from './edgeApi';
|
||||
|
|
@ -14,7 +13,6 @@ import { rhsmApi } from './rhsmApi';
|
|||
export const reducer = {
|
||||
clones: clonesSlice,
|
||||
composes: composesSlice,
|
||||
[complianceApi.reducerPath]: complianceApi.reducer,
|
||||
[contentSourcesApi.reducerPath]: contentSourcesApi.reducer,
|
||||
[edgeApi.reducerPath]: edgeApi.reducer,
|
||||
[imageBuilderApi.reducerPath]: imageBuilderApi.reducer,
|
||||
|
|
@ -26,7 +24,6 @@ export const reducer = {
|
|||
export const middleware = (getDefaultMiddleware: Function) =>
|
||||
getDefaultMiddleware().concat(
|
||||
promiseMiddleware,
|
||||
complianceApi.middleware,
|
||||
contentSourcesApi.middleware,
|
||||
imageBuilderApi.middleware,
|
||||
rhsmApi.middleware,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue