Git Product home page Git Product logo

t1c-lib-js's People

Contributors

dependabot[bot] avatar gillespl avatar ikbendewilliam avatar lowfill avatar maaso avatar michallis avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

loopingz

t1c-lib-js's Issues

Unused dependencies

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

Regression in GCLConfig

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

Help with implementation of eID - You cannot consume this service

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.

GCL Mac Installer

Hi there,

Where could I find the Mac OS installer for GCL ?

Thanks ๐Ÿ‘

Failure to init PKCS#11 container

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)

Remove overwriting of JSON.stringify

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);
}
});

Fix gulp version

when asking the version of the t1c-lib-js it must show the correct version.

Polling for download containers resolves when still in downloading status

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).

Polling for download containers resolves when still in downloading status

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).

Typings inconsistencies

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:

  • Both are string (preferred one)
    • slot_id -> string
    • slotId -> string
  • Both are number
    • slot_id -> number
    • slotId -> number

Thank you,
Alexis GEORGES

Import lib by webpack 4 and angular 5 project

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.