Skip to content

Commit

Permalink
feat(Okta Node): Add Okta Node (#10278)
Browse files Browse the repository at this point in the history
Co-authored-by: Giulio Andreini <[email protected]>
Co-authored-by: Elias Meire <[email protected]>
  • Loading branch information
3 people authored Aug 12, 2024
1 parent 71b6c67 commit 5cac0f3
Show file tree
Hide file tree
Showing 11 changed files with 1,414 additions and 4 deletions.
7 changes: 5 additions & 2 deletions packages/core/bin/generate-ui-types
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ function findReferencedMethods(obj, refs = {}, latestName = '') {
const knownCredentials = loader.known.credentials;
const credentialTypes = Object.values(loader.credentialTypes).map((data) => {
const credentialType = data.type;
if (knownCredentials[credentialType.name].supportedNodes?.length > 0) {
delete credentialType.httpRequestNode;
if (
knownCredentials[credentialType.name].supportedNodes?.length > 0 &&
credentialType.httpRequestNode
) {
credentialType.httpRequestNode.hidden = true;
}
return credentialType;
});
Expand Down
4 changes: 3 additions & 1 deletion packages/editor-ui/src/stores/credentials.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ export const useCredentialsStore = defineStore(STORES.CREDENTIALS, () => {
});

const httpOnlyCredentialTypes = computed(() => {
return allCredentialTypes.value.filter((credentialType) => credentialType.httpRequestNode);
return allCredentialTypes.value.filter(
(credentialType) => credentialType.httpRequestNode && !credentialType.httpRequestNode.hidden,
);
});

// #endregion
Expand Down
3 changes: 2 additions & 1 deletion packages/nodes-base/credentials/OktaApi.credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ export class OktaApi implements ICredentialType {
placeholder: 'https://dev-123456.okta.com',
},
{
displayName: 'SSWS Access Token',
displayName: 'Access Token',
name: 'accessToken',
type: 'string',
typeOptions: { password: true },
required: true,
default: '',
description: 'Secure Session Web Service Access Token',
},
];

Expand Down
3 changes: 3 additions & 0 deletions packages/nodes-base/nodes/Okta/Okta.dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 56 additions & 0 deletions packages/nodes-base/nodes/Okta/Okta.node.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import type { INodeType, INodeTypeDescription } from 'n8n-workflow';
import { userFields, userOperations } from './UserDescription';
import { getUsers } from './UserFunctions';

export class Okta implements INodeType {
description: INodeTypeDescription = {
displayName: 'Okta',
name: 'okta',
icon: { light: 'file:Okta.svg', dark: 'file:Okta.dark.svg' },
group: ['transform'],
version: 1,
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
description: 'Use the Okta API',
defaults: {
name: 'Okta',
},
inputs: ['main'],
outputs: ['main'],
credentials: [
{
name: 'oktaApi',
required: true,
},
],
requestDefaults: {
returnFullResponse: true,
baseURL: '={{$credentials.url.replace(new RegExp("/$"), "")}}',
headers: {},
},
properties: [
{
displayName: 'Resource',
name: 'resource',
type: 'options',
noDataExpression: true,
options: [
{
name: 'User',
value: 'user',
},
],
default: 'user',
},

// USER
...userOperations,
...userFields,
],
};

methods = {
listSearch: {
getUsers,
},
};
}
3 changes: 3 additions & 0 deletions packages/nodes-base/nodes/Okta/Okta.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 5cac0f3

Please sign in to comment.