n8n/packages/nodes-base/credentials/HttpBasicAuth.credentials.ts

32 lines
548 B
TypeScript
Raw Normal View History

import type { ICredentialType, INodeProperties } from 'n8n-workflow';
2019-06-23 03:35:23 -07:00
export class HttpBasicAuth implements ICredentialType {
name = 'httpBasicAuth';
2019-06-23 03:35:23 -07:00
displayName = 'Basic Auth';
documentationUrl = 'httpRequest';
feat(core): Allow credential reuse on HTTP Request node (#3228) * :sparkles: Create controller * :zap: Mount controller * :pencil2: Add error messages * :sparkles: Create scopes fetcher * :zap: Account for non-existent credential type * :blue_book: Type scopes request * :zap: Adjust error message * :test_tube: Add tests * :sparkles: Introduce simple node versioning * :zap: Add example how to read version in node-code for custom logic * :bug: Fix setting of parameters * :bug: Fix another instance where it sets the wrong parameter * :zap: Remove unnecessary TOODs * :sparkles: Re-version HTTP Request node * :shirt: Satisfy linter * :zap: Retrieve node version * :rewind: Undo Jan's changes to Set node * :test_tube: Fix CI/CD for `/oauth2-credential` tests (#3230) * :bug: Fix notice warning missing background color (#3231) * :bug: Check for generic auth in node cred types * :zap: Refactor credentials dropdown for HTTP Request node (#3222) * :zap: Discoverability flow (#3229) * :sparkles: Added node credentials type proxy. Changed node credentials input order. * :zap: Add computed property from versioning branch * :bug: Fix cred ref lost and unsaved * :zap: Make options consistent with cred type names * :zap: Use prop to set component order * :zap: Use constant and version * :zap: Fix rendering for generic auth creds * :zap: Mark as required on first selection * :zap: Implement discoverability flow * :zap: Mark as required on subsequent selections * :zap: Fix marking as required after cred deletion * :zap: Refactor to clean up * :zap: Detect position automatically * :zap: Add i18n to option label * :zap: Hide subtitle for custom action * :zap: Detect active credential type * :zap: Prop drilling to re-render select * :fire: Remove unneeded property * :pencil2: Rename arg * :fire: Remove unused import * :fire: Remove unneeded getters * :fire: Remove unused import * :zap: Generalize cred component positioning * :zap: Set up request * :bug: Fix edge case in endpoint * :zap: Display scopes alert box * :rewind: Revert "Generalize cred comp positioning" This reverts commit 75eea89273b854110fa6d1f96c7c1d78dd3b0731. * :zap: Consolidate HTTPRN check * :zap: Fix hue percentage to degree * :fire: Remove unused import * :fire: Remove unused import * :fire: Remove unused class * :fire: Remove unused import * :blue_book: Create type for HTTPRN v2 auth params * :pencil2: Rename check * :fire: Remove unused import * :pencil2: Add i18n to `reportUnsetCredential()` * :zap: Refactor Alex's spacing changes * :zap: Post-merge fixes * :zap: Add docs link * :fire: Exclude Notion OAuth cred * :pencil2: Update copy * :pencil2: Rename param * :art: Reposition notice and simplify styling * :pencil2: Update copy * :pencil2: Update copy * :zap: Hide params during custom action * :zap: Show notice if any cred type supported * :bug: Prevent scopes text overflow * :fire: Remove superfluous check * :pencil2: Break up docstring * :art: Tweak notice styling * :zap: Reorder cred param in Webhook node * :pencil2: Shorten cred name in scopes notice * :test_tube: Update Notice snapshots * :bug: Fix check when `globalRole` is `undefined` * :rewind: Revert 3f2c4a6 * :zap: Apply feedback from Product * :test_tube: Update snapshot * :zap: Adjust regex expansion pattern for singular * :fire: Remove unused import * :fire: Remove logging * :zap: Make `somethingElse` key more unique * :zap: Move something else to constants * :zap: Consolidate notice component * :zap: Apply latest feedback * :test_tube: Update tests * :test_tube: Update snapshot * :pencil2: Fix singular version * :test_tube: Finalize tests * :pencil2: Rename constant * :test_tube: Expand tests * :fire: Remove `truncate` prop * :truck: Move scopes fetching to store * :truck: Move method to component * :zap: Use constant * :zap: Refactor `Notice` component * :test_tube: Update tests * :fire: Remove unused keys * :zap: Inject custom API call option * :fire: Remove unused props * :art: Use `compact` prop * :test_tube: Update snapshots * :truck: Move scopes to store * :truck: Move `nodeCredentialTypes` to parent * :pencil2: Rename cred types per branding * :bug: Clear scopes when none * :zap: Add default * :truck: Move `newHttpRequestNodeCredentialType` to parent * :fire: Remove test data * :zap: Separate lines for readability * :zap: Change reference from node to node name * :pencil2: Rename i18n keys * :zap: Refactor OAuth check * :fire: Remove unused key * :truck: Move `OAuth1/2 API` to i18n * :zap: Refactor `skipCheck` * :zap: Add `stopPropagation` and `preventDefault` * :truck: Move active credential scopes logic to store * :art: Fix spacing for `NodeWebhooks` component * :zap: Implement feedback * :zap: Update HTTPRN default and issue copy * Refactor to use `CredentialsSelect` param (#3304) * :zap: Refactor into cred type param * :zap: Componentize scopes notice * :fire: Remove unused data * :fire: Remove unused `loadOptions` * :zap: Componentize `NodeCredentialType` * :bug: Fix param validation * :fire: Remove dup methods * :zap: Refactor all references to `isHttpRequestNodeV2` * :art: Fix styling * :fire: Remove unused import * :fire: Remove unused properties * :art: Fix spacing for Pipedrive Trigger node * :art: Undo Webhook node styling change * :fire: Remove unused style * :zap: Cover `httpHeaderAuth` edge case * :bug: Fix `this.node` reference * :truck: Rename to `credentialsSelect` * :bug: Fix mistaken renaming * :zap: Set one attribute per line * :zap: Move condition to instantiation site * :truck: Rename prop * :zap: Refactor away `prepareScopesNotice` * :pencil2: Rename i18n keys * :pencil2: Update i18n calls * :pencil2: Add more i18n keys * :fire: Remove unused props * :pencil2: Add explanatory comment * :zap: Adjust check in `hasProxyAuth` * :zap: Refactor `credentialSelected` from prop to event * :zap: Eventify `valueChanged`, `setFocus`, `onBlur` * :zap: Eventify `optionSelected` * :zap: Add `noDataExpression` * :fire: Remove logging * :fire: Remove URL from scopes * :zap: Disregard expressions for display * :art: Use CSS modules * :blue_book: Tigthen interface * :bug: Fix generic auth display * :bug: Fix generic auth validation * :blue_book: Loosen type * :truck: Move event params to end * :zap: Generalize reference * :zap: Refactor generic auth as `credentialsSelect` param * :rewind: Restore check for `httpHeaderAuth ` * :truck: Rename `existing` to `predefined` * Extend metrics for HTTP Request node (#3282) * :zap: Extend metrics * :test_tube: Add tests * :zap: Update param names Co-authored-by: Alex Grozav <alex@grozav.com> * :zap: Update check per new branch * :zap: Include generic auth check * :zap: Adjust telemetry (#3359) * :zap: Filter credential types by label Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com> Co-authored-by: Alex Grozav <alex@grozav.com>
2022-05-24 02:36:19 -07:00
genericAuth = true;
:sparkles: Update credentials modal (#2154) * :zap: Generalize unique entity name generation * :zap: Standardize variable names * redo credentials * revert some changes, replace got with was * fix v-if order * fix v-if order * update linting * update gulpfile * update ssh display name * update height * update params * update info tip sizes * address design comments * update google button disabled * update icon size to 28px * update design issues * update info tab design * address design comments * update tab size * update run data spacing * address comments, update logo design * fix spacing issues * clean up store * fix create new bug * add loading state * rename prop * remove unused prop * fix select bug * remove label tag * update word break * build * address design comments * update font family of button * update menu opacity * update text * update title * address more comments * update oauth messages * add oauth validation * hide disabled state * update warning modal * show button on text input * clean up cred details * add validation errors * fix bug when deleting cred * Frontend hack to display test button * Created interfaces for testing and endpoint * Testing slack node credentials working * Adding test with node to endpoint for credential testing * Fixed linting and test detectability * Adding required for slack token * Added google sheets credential testing * update message * Adding suggestions by Ivan and Mutasem * Address comments * keep blurred when focused * update font weight of errors * add oauth banner * remove toast * Fixed code bug and added telegram credential testing * scroll to top on success * clean up duplication * Fixed telegram trigger node and added tests to typeform * refactor modal * add more validation support * refactor info tab * scroll to bottom on save, handle cred saving * refactor save button * save cred on valid * save cred on valid * scroll to top if has error * add targets on input labels * delete credentails input * revert fe changes * update validation logic * clean interface * test credentials * update banner design * show testing state * update x position * fix issues * fix focus issues * clean up validation behavior * make error relative * update banner component * update error spacing * don't close dialog * rename button * update how banners behave * if has unsaved changes first * move confirm message * add success banner * update time state * disable transitions * test on open * clean up banner behavior * update banner styling * capitalize * update error banner styling to handle long texts * avoid unnessary content jostling * add loading label * show validation warnings when opening modal * retest cred if not all props req * update scroll to auto * add error warning * update color saturation * set overflow to auto * fix bug to get credentials when connected * round down to minutes * change tab name * update casing oauth * disable credential testing if it has expressions * label same as title * add more space between close and save * remove check on making any changes * hide close on confirm modals * don't accept clicks outside dialog * fix build issues * undo test changes * fix table scrollbar logs * rename modals * fix bug with same name * refactor modal * fix tslint issue * refactor name * update name behavior * update monospace font * remove comment * refactor inputs * refactor error handling * reduce spacing changes * fix doc url oauth1 oauth2 * build * hide infotip if no inputs * address most comments * rename file * fix menu alignment * gst * update types Co-authored-by: Iván Ovejero <ivov.src@gmail.com> Co-authored-by: Omar Ajoue <krynble@gmail.com>
2021-09-11 01:15:36 -07:00
icon = 'node:n8n-nodes-base.httpRequest';
properties: INodeProperties[] = [
2019-06-23 03:35:23 -07:00
{
displayName: 'User',
name: 'user',
type: 'string',
2019-06-23 03:35:23 -07:00
default: '',
},
{
displayName: 'Password',
name: 'password',
type: 'string',
2019-06-23 03:35:23 -07:00
typeOptions: {
password: true,
},
default: '',
},
];
}