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(core): add POST /saml-applications and DEL /saml-applications/:id APIs #6822

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

darcyYe
Copy link
Contributor

@darcyYe darcyYe commented Nov 19, 2024

Summary

Add following APIs:

  1. POST /saml-applications
  2. DEL /saml-applications/:id

This PR resolves LOG-10114 and LOG-10374, can find design here.

Testing

Add integration tests.

Checklist

  • .changeset
  • unit tests
  • integration tests
  • necessary TSDoc comments

@github-actions github-actions bot added the feature Cool stuff label Nov 19, 2024
Copy link

github-actions bot commented Nov 19, 2024

COMPARE TO master

Total Size Diff ⚠️ 📈 +17.99 KB

Diff by File
Name Diff
packages/core/package.json 📈 +182 Bytes
packages/core/src/routes/applications/application.ts 📈 +15 Bytes
packages/core/src/routes/init.ts 📈 +177 Bytes
packages/core/src/routes/swagger/utils/documents.ts 📈 +100 Bytes
packages/core/src/routes/swagger/utils/general.ts 📈 +1017 Bytes
packages/core/src/routes/well-known/well-known.openapi.ts 📈 +1 Bytes
packages/core/src/saml-applications/libraries/secrets.ts 📈 +915 Bytes
packages/core/src/saml-applications/libraries/utils.ts 📈 +1.82 KB
packages/core/src/saml-applications/queries/configs.ts 📈 +1.15 KB
packages/core/src/saml-applications/queries/secrets.ts 📈 +1.31 KB
packages/core/src/saml-applications/routes/index.openapi.json 📈 +3.2 KB
packages/core/src/saml-applications/routes/index.ts 📈 +2.96 KB
packages/core/src/saml-applications/routes/utils.ts 📈 +595 Bytes
packages/core/src/tenants/Libraries.ts 📈 +177 Bytes
packages/core/src/tenants/Queries.ts 📈 +342 Bytes
packages/integration-tests/src/api/saml-application.ts 📈 +471 Bytes
packages/integration-tests/src/tests/api/application/application.test.ts 📈 +6 Bytes
packages/integration-tests/src/tests/api/application/saml-application.test.ts 📈 +2.74 KB
packages/phrases/src/locales/en/errors/application.ts 📈 +207 Bytes
packages/schemas/src/types/index.ts 📈 +39 Bytes
packages/schemas/src/types/saml-application.ts 📈 +1.52 KB
packages/schemas/tables/saml_application_configs.sql 📈 +69 Bytes
pnpm-lock.yaml 📈 +942 Bytes

@darcyYe darcyYe force-pushed the yemq-add-post-saml-app-api branch 3 times, most recently from 71f4a15 to e500da4 Compare November 19, 2024 16:04
@github-actions github-actions bot added size/xl and removed size/l labels Nov 19, 2024
@darcyYe darcyYe force-pushed the yemq-add-post-saml-app-api branch 6 times, most recently from 87665e1 to 2c8ef08 Compare November 20, 2024 04:58
@darcyYe darcyYe changed the title feat(core): add POST /saml-applications and DEL /saml-applications/:id APIs feat(core): add POST /saml-applications and DEL /saml-applications/:id APIs Nov 20, 2024
@darcyYe darcyYe marked this pull request as ready for review November 20, 2024 05:00
@darcyYe darcyYe force-pushed the yemq-log-10113-add-saml-application-proxies-table branch from 97dfb47 to c28b5dc Compare November 20, 2024 07:45
@darcyYe darcyYe force-pushed the yemq-log-10113-add-saml-application-proxies-table branch from 5554cf6 to 4e3a6a6 Compare November 20, 2024 09:32
@darcyYe darcyYe force-pushed the yemq-add-post-saml-app-api branch 4 times, most recently from f767449 to e618f18 Compare November 20, 2024 16:58
@darcyYe darcyYe force-pushed the yemq-log-10113-add-saml-application-proxies-table branch from 4e3a6a6 to 57a1561 Compare November 21, 2024 10:05
@darcyYe darcyYe force-pushed the yemq-log-10113-add-saml-application-proxies-table branch from 57a1561 to 6faece8 Compare November 21, 2024 14:36
@darcyYe darcyYe force-pushed the yemq-add-post-saml-app-api branch 6 times, most recently from 68bd363 to 901892b Compare November 22, 2024 06:09
Base automatically changed from yemq-log-10113-add-saml-application-proxies-table to master November 22, 2024 06:56
Comment on lines +35 to +40
secrets: SamlApplicationSecrets.guard
.omit({
tenantId: true,
applicationId: true,
})
.array(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about defining a specific API for the secret? I think this is how our application endpoints were designed.

@@ -207,7 +213,7 @@ export const buildUserApiBaseDocument = (
});

export const getSupplementDocuments = async (
directory = 'routes',
directory = 'build',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might need some more context for this


import { generateKeyPairAndCertificate } from './utils.js';

export const createSamlApplicationSecretsLibrary = (queries: Queries) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just keep one single SAML application library?

samlApplicationSecrets: { insertSamlApplicationSecret },
} = queries;

const createNewSamlApplicationSecretForApplication = async (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about just simply createSamlApplicationSecret or keyPairs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants