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: allow retrieving platform info using API key #36

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
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
32 changes: 29 additions & 3 deletions packages/server/api/src/app/platform/platform.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
Platform,
PlatformWithoutSensitiveData,
Principal,
PrincipalType,
UpdatePlatformRequestBody,
} from '@activepieces/shared'

Expand Down Expand Up @@ -50,16 +51,38 @@ const buildResponse = ({
}
}

const { id, name, defaultLocale, projectRolesEnabled, gitSyncEnabled, flowIssuesEnabled } = platform
return { id, name, defaultLocale, projectRolesEnabled, gitSyncEnabled, flowIssuesEnabled }
const {
id,
name,
defaultLocale,
projectRolesEnabled,
gitSyncEnabled,
flowIssuesEnabled,
} = platform
return {
id,
name,
defaultLocale,
projectRolesEnabled,
gitSyncEnabled,
flowIssuesEnabled,
}
}

type BuildResponseParams = {
platform: Platform
principal: Principal
}

type PlatformBasics = Pick<Platform, 'id' | 'name' | 'defaultLocale' | 'projectRolesEnabled' | 'gitSyncEnabled' | 'flowIssuesEnabled'>
type PlatformBasics = Pick<
Platform,
| 'id'
| 'name'
| 'defaultLocale'
| 'projectRolesEnabled'
| 'gitSyncEnabled'
| 'flowIssuesEnabled'
>

const UpdatePlatformRequest = {
schema: {
Expand All @@ -74,6 +97,9 @@ const UpdatePlatformRequest = {
}

const GetPlatformRequest = {
config: {
allowedPrincipals: [PrincipalType.USER, PrincipalType.SERVICE],
},
schema: {
params: Type.Object({
id: ApId,
Expand Down
Loading