Conversation
|
Note; please replace the Ternary image with one uploaded to the static section of the OpenOps website |
| } | ||
| try { | ||
| const decoded = jwtDecode(token); | ||
| if (decoded && decoded.exp && dayjs().isAfter(dayjs.unix(decoded.exp))) { |
There was a problem hiding this comment.
Very minor: for readability, would be better to extract this to a var and be explicit in the name. Also note that the IF will evaluate to false if the decoding failed/there is no exp. Perhaps it should be something like:
var isValid = decoded && decoded.exp && dayjs().isBefore(dayjs.unix(decoded.exp));
return isValid;
(that said, is it a valid use case in ternary tokens that there is no exp?)
There was a problem hiding this comment.
I re-used this from 'allow-logged-in-user-only-guard.tsx'. Altered it for better readability. However the function expects a boolean in return so I had to work around that in the return.
Do you have a better solution?
| @@ -0,0 +1,42 @@ | |||
| import { | |||
| AuthenticationType, | |||
| // HttpMessageBody, | |||
packages/blocks/ternary/src/index.ts
Outdated
| @@ -0,0 +1,17 @@ | |||
| import { createBlock } from '@openops/blocks-framework'; | |||
| // import { ternaryAuth } from '@openops/common'; | |||
packages/blocks/ternary/src/index.ts
Outdated
| auth: ternaryCloudAuth, | ||
| minimumSupportedRelease: '0.20.0', | ||
| logoUrl: | ||
| 'https://firebasestorage.googleapis.com/v0/b/quilops-712fd.firebasestorage.app/o/public%2Fternary-logo.png?alt=media&token=20820a50-f4ae-4385-942b-bb58cb7cb5cf', |
There was a problem hiding this comment.
Uploaded to static.openops.com/blocks/ternary.png
| @@ -17,100 +17,47 @@ | |||
| "skipDefaultLibCheck": true, | |||
| "baseUrl": ".", | |||
| "paths": { | |||
There was a problem hiding this comment.
what happened here? some auto-linter change?
There was a problem hiding this comment.
I have not touched this, must be auto changed.
package.json
Outdated
| "ts-node": "10.9.1", | ||
| "turbowatch": "2.29.4", | ||
| "typescript": "5.5.4", | ||
| "verdaccio": "^5.0.4", |
There was a problem hiding this comment.
We never really used it, did you see any improvement?
The blocks are not published to npm anyway, it's all loaded locally with npm link.
There was a problem hiding this comment.
I never installed this, don't even know what it is/does
There was a problem hiding this comment.
Ok I reverted it, not sure where it came from
|
@rita-gorokhod I've updated the files |
|



Fixes OPS-1517.
Ternary connection & sample action
New connection using the Ternary API
Fields:
Additional Notes
The supporting API call checks if the JWT (API KEY) is valid before accessing the URL.
Testing Checklist
Check all that apply:
[x ] I tested the feature thoroughly, including edge cases
[x ] I verified all affected areas still work as expected
Automated tests were added/updated if necessary
Changes are backwards compatible with any existing data, otherwise a migration script is provided