trust1team / t1c-lib-js Goto Github PK
View Code? Open in Web Editor NEWTrust1Connector Library JavaScript
License: Other
Trust1Connector Library JavaScript
License: Other
T1C-JS use PBKDF2 for PIN without pinpad to GCLAs PBKDF2 is part of WebCryptoAPI it can be used to prevent pin exposure to the browser
the library always needs a correct pubkey from the DS, this means it should also set a correct pubkey in the DS and then retrieve a correct pubkey from the DS, while syncing.
Hello,
After trying your version 2.2.0, I saw you have at least one unused/useless dependency which is installed with your library when we install it. -> "npm": "^6.1.0
There is also path
which is normally included with node directly. I think you can also remove this dependency.
Finally, I think a cleanup of your dependencies could be necessary and in the same time you could update some of them.
Thanks.
Alexis GEORGES
Hello,
Previously (version 2.1.7), there was a class GCLConfigOptions which allowed to pass typed object throught GCLConfig constructor which was really useful.
Since version 2.1.8, GCLConfigOptions class has been removed and the signature of the constructor of GCLConfig is now constructor(options: any).
It was a bit better before because we had the auto-completion and the validation of the object itself, even if the class forced all properties as required instead of optional (which was annoying because that forced us to cast the object as "any").
Could you please add back the GCLConfigOptions class and improve this a bit by making optional properties optional.
Thank you.
Alexis GEORGES
Hi I have problem implement with this lib.
t1c-lib-js ver. 2.12
I already have this configuration:
async prepareGCL(config: GCLConfigOptions) {
try {
const gclConfig = new GCLConfig(config);
const client: GCLClient = await GCLClient.initialize(gclConfig);
const readers: CardReadersResponse = await client.core().readersCardAvailable();
if (readers.data.length) {
return client.beid(readers.data[0].id).allData({filters: ['rn', 'address', 'picture'], parseCerts: false});
}
} catch (e) {
}
throw Error('No readers');
}
but always i get message
No installed GCL component found. Please download and install the GCL.
Also Im little confused how to download GCL,
Its should lib promt to download right?
Ill implement also node api to retrieving token by api_key.
But for now i dont have clue how to download GCL in nice user way.
When in the config the Gateway and DS are configured the library still wants to activate while the GCL is already activated
Hi there,
Where could I find the Mac OS installer for GCL ?
Thanks ๐
Uncaught (in promise) TypeError: Cannot read property 'get' of undefined
at Function.ActivatedContainerUtil.getContainerFor (ActivatedContainerUtil.ts:11)
at PKCS11.containerSuffix (pkcs11.ts:136)
at PKCS11.slots (pkcs11.ts:109)
at GCLLib.GCLClient.initialize.then.res (app.js:54)
The library overwrites the JSON.stringify function on compilation. This has a negative impact on performance.
// 24.3.2 JSON.stringify(value [, replacer [, space]])
$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {
var S = $Symbol();
// MS Edge converts symbol values to JSON as {}
// WebKit converts symbol values to JSON as null
// V8 throws on boxed symbols
return _stringify([S]) != '[null]' || _stringify(
{ a: S }
) != '{}' || _stringify(Object(S)) != '{}';
})), 'JSON', {
stringify: function stringify(it) {
var args = [it];
var i = 1;
var replacer, $replacer;
while (arguments.length > i) args.push(arguments[i++]);
$replacer = replacer = args[1];
if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
if (!isArray(replacer)) replacer = function (key, value)
{ if (typeof $replacer == 'function') value = $replacer.call(this, key, value); if (!isSymbol(value)) return value; }
;
args[1] = replacer;
return _stringify.apply($JSON, args);
}
});
Pass encrypted pin to
when asking the version of the t1c-lib-js it must show the correct version.
Make hard-coded tokenExchangeContextPath property configurable
When an GCL downloads several containers the status goes from downloading to installed, the javascript library should wait for using that container until the download has finished.
Current issue is that the javascript library uses the container when it is still downloading, resulting in an error.
This can be reproduced by uninstalling the GCL and going to RMC and installing while on the application and being on a slow network(this will slow down the downloading process).
When retrieving a agent, the username is now mandatory.
When an GCL downloads several containers the status goes from downloading to installed, the javascript library should wait for using that container until the download has finished.
Current issue is that the javascript library uses the container when it is still downloading, resulting in an error.
This can be reproduced by uninstalling the GCL and going to RMC and installing while on the application and being on a slow network(this will slow down the downloading process).
Generic Interface should enforce a container based implementation for generic use cases.
Hello,
I found an inconsistency in your types for Pkcs11Slot / Pkcs11TokenInfo classes and certificates() method.
In Pkcs11Slot object, we can read the slot_id (type string) and then we can get the certificate through certificates by passing slotId (type number) parameter. That forces us to cast slot_id as a number for passing it through certificates method which is not recommended.
Is there a reason for this ?
Otherwise, could you please adapt this for one of those 2 cases:
Thank you,
Alexis GEORGES
Hi,
We have huge Angular project, bundled by webpack 4.
I install your lib on version 2.1.6 by
npm i trust1connector
we have this code
import { CardReadersResponse, GCLClient, GCLConfig, GCLConfigOptions } from 'trust1connector';
....
getEid() {
const options = new GCLConfigOptions();
options.apiKey = globals.trust1Key;
options.gwOrProxyUrl = 'https://apim.t1t.be:443';
const gclConfig = new GCLConfig(options);
return Observable.fromPromise(GCLClient.initialize(gclConfig))
.flatMap((client: GCLClient) => {
return Observable.fromPromise(client.core().readersCardAvailable())
.flatMap((readers: CardReadersResponse) => {
if (readers.data.length) {
return Observable.fromPromise(client.beid(readers.data[0].id).allData({
filters: ['rn', 'address', 'picture'],
parseCerts: false
}));
}
return Observable.throw('No readers');
});
}).subscribe();
}
But on load module we get error like this
Uncaught TypeError: trust1connector_1.GCLConfigOptions is not a constructor
When i try load just lib
GCLClient.initialize({});
we get this error
Uncaught TypeError: Cannot read property 'initialize' of undefined
During both the register/activate and sync operations, the JS lib should update (or store) the DS public key on the device (GCL /admin/certificates call) before attempting to load ATR list or containers. Otherwise the call will fail if the DS certificate is not set or up to date.
exclude global variable lodash
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.