GithubHelp home page GithubHelp logo

labs64 / netlicensingclient-csharp Goto Github PK

View Code? Open in Web Editor NEW
24.0 8.0 16.0 263 KB

C# wrapper for Labs64 NetLicensing RESTful API

Home Page: https://netlicensing.io

License: Apache License 2.0

C# 100.00%
netlicensing license license-management licensing activation wrapper laas licensing-as-a-service entitlement validation

netlicensingclient-csharp's People

Contributors

dependabot[bot] avatar ihtims avatar kkorotkov avatar r-brown avatar v-rudkovskiy avatar yushkevich avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

netlicensingclient-csharp's Issues

Wiki lists signatures as not implemented

The wiki page states that response signature "is currently only implemented in the Java NetLicensing Client library", but issue #16 is closed and there's a bunch of signature-related code in netlicensing-context.cs. At the same time, issue #25 seems to indicate that it doesn't work if you target .NET Framework.

So what is the status?

If it's implemented, the wiki page should be updated. And if it's only working for .NET Core that should be mentioned as well.

Emulate and Run issue

I'd like to see this. And run it as a template.ayne use it if it checks out and is a good structure but..Can you please tell me, How do I see it visually besides the folders and content/conde within the folders.

Do I have to copy each folder and ensure it looks the same in my android studio then run an emulator to it or what

Sorry this should be basic knowledge to any user on this site however they don't really walk you through anything. Let alone getting on contact with the developer who posted his code

Thanks for the advise and help

Also am looking to be mentored if that's something that interests you let me know

As I'd love it if the original code writer would want to find turn the script to meet the requirements I need met.

Let me know.

~ EASTinphectiON

Validation request parameter numbering

The wiki page for Licensee Services states that model-specific validation parameters must be passed with a number suffixed to the parameter name, so that parameters belonging to different modules passed in the same request can be separated. This doesn't work as documented.

I have a PayPerUse module. If I issue a validation request with only that module in the request, and parameters created using ValidationParameters.put(moduleID, "reserveQuantity0", "1") (in order to reduce the remaining quantity by one), it doesn't work.
But if I create the parameter with put(moduleID, "reserveQuantity", "1") it does work.

On the Javadoc page for ValidationParameters, put() is undocumented. It is also uncommented in the C# source.

So is it the case that ValidationParameters.put() handles the numbering and I should always use the parameter name without numbers?
Or must parameters be numbered only if there is more than one module in the validation request? (There is no mention of that on the Licensee Services page).
Or is it that numbered parameters are not supported for PayPerUse modules (or even just for pre-payment)? Again, there is no mention of any different parameter numbering rules for this licensing model.

Does NetLicensing support desktop applications?

In the only sample there's, to create a context and authorize, I can only use either basic authentication with my own credentials, or pass the only API key, that has basically the same access.

Now that, obviously, does not work for desktop applications, because that means I would have to ship my API key with the applications, so users would be able to extract it and wreck chaos to my NetLicensing account.

Is there any plan to support NetLicensing for desktop applications?

500 status code when try to validate a licensee

When I try to validate a licensee without any additional validate parameters (empty ValidationParameters object), just using Licensee Number I get 500 response.
I think it happened because the request Body is empty and ContentType not equal to "application/x-www-form-urlencoded".

Filter on "list" operation don't seem to work

Hi everyone,
I have try to get all active license based on a licensee number, but i don't seem to reach any data that respect my filter.
I didn't find information about filter in the wiki (https://netlicensing.io/wiki/license-services#licenses-list) or in the Api playground ( https://netlicensing.io/NetLicensing-API/#/).

I have tried some syntax but no result. here what I have tested :

  • LicenseService.list(context, licensee.number)
  • LicenseService.list(context,""licenseeNumber": "licenseeNumber"" )
  • LicenseService.list(context, "&licenseeNumber=licenseeNumber"");

I have tried the same with "active" or with a parameter of the license (requestid) but no change.

I could filter all the license after received them but in case of the number of license receive in the json exceed a limit that could be problematic

Did I miss something in my implementation or in the wiki ?

Improve APIKey documentation

Add explicite comment on/at (relevant methods and demo samples):

  • what is the scope of the APIKey
  • what is the access level

NetLicensing Blazor Integration

Hi Guys,

I VERY new to Blazor and I was wondering if you could please point me in the correct direction on integrating NetLicensing into a Blazor Application?
This Application has a login per Organization. The Application has Modules. Each Organization will have a license per Module.
What is the correct way of doing it and integrating it into the Blazor Application? I have no idea where to start.

Thanks in advance!

PayPerUse validation incorrect

According to the wiki page for the PayPerUse licensing model, a validation response will contain valid=true if the sum of quantity of all active licenses (given credits) is bigger than the sum of usedQuantity of these licenses (used credits).

In fact, valid=true is also returned (alongside remainingQuantity=0) if the numbers are equal.

valid=false is only returned if (in pre-payment mode) you issue a validation with reserveQuantity=N and N is greater than the number of remaining credits.
(Note: I have only tried issuing calls with reserveQuantity=1, and only get valid=false if there are no credits remaining. I don't know for sure what would happen if there were 10 credits remaining and you asked for 11.)

So if the current behaviour is intended, the documentation needs to be corrected.
But to say that a PayPerUse license is valid when there are no uses left seems a little strange to me.

licenseeSecret

licenseeSecret is not implemented in the initial validate ?

Bad Javadoc URLs

Throughout the code, there are references to the NetLicensingAPI Javadoc documentation. However, some of these URLs point to http://netlicensing.labs64.com, which isn't working. They should probably be changed to https://go.netlicensing.io.

The paths also need checking. For instance, NetLicensingClient/Entities/Licensee.cs contains the URL
http://netlicensing.labs64.com/javadoc/v2/com/labs64/netlicensing/common/domain/entity/Licensee.html
but the "common" directory seems to have been removed on the netlicensing.io site, so the corresponding URL should be
https://go.netlicensing.io/javadoc/v2/com/labs64/netlicensing/domain/entity/Licensee.html

The following files contain labs64.com URLs:
NetLicensingClient/Entities/BaseEntity.cs
NetLicensingClient/Entities/License.cs
NetLicensingClient/Entities/Licensee.cs
NetLicensingClient/Entities/LicenseTemplate.cs
NetLicensingClient/Entities/netlicensing-context.cs
NetLicensingClient/Entities/PaymentMethod.cs
NetLicensingClient/Entities/Product.cs
NetLicensingClient/Entities/ProductModule.cs
NetLicensingClient/Entities/Token.cs
NetLicensingClient/Entities/Transaction.cs
NetLicensingClient/Entities/ValidationResult.cs
NetLicensingClient/LicenseeService.cs
NetLicensingClient/LicenseService.cs
NetLicensingClient/LicenseTemplateService.cs
NetLicensingClient/NetLicensingClient.xml
NetLicensingClient/PaymentMethodService.cs
NetLicensingClient/ProductModuleService.cs
NetLicensingClient/ProductService.cs
NetLicensingClient/TokenService.cs
NetLicensingClient/TransactionService.cs

NuGet package breaks .NET Framework / .NET Core WinForms project

If you add NetLicensingClient 2.4.2 to a Windows Forms project targeting .NET Framework or .NET Core, the project breaks completely. Visual Studio lists a number of CS0518 errors, e.g.

"CS0518: Predefined type 'System.Void' is not defined or imported"

mscorlib cannot be added as a reference, because

"This component is already automatically referenced by the build system."

I have noticed that there appear to be two errors reported by NuGet, but it's not clear exactly what it's complaining about.
Here is the output from adding the package to a just-created .NET Framework project. Note the "reference cannot be removed" messages towards the end:

    Attempting to gather dependency information for package 'NetLicensingClient-csharp.2.4.2' with respect to project 'WindowsFormsAppFwk1', targeting '.NETFramework,Version=v4.8'
    Gathering dependency information took 691 ms
    Attempting to resolve dependencies for package 'NetLicensingClient-csharp.2.4.2' with DependencyBehavior 'Lowest'
    Resolving dependency information took 0 ms
    Resolving actions to install package 'NetLicensingClient-csharp.2.4.2'
    Resolved actions to install package 'NetLicensingClient-csharp.2.4.2'
    Adding package 'BouncyCastle.1.8.6.1' to folder '{redacted}\packages'
    Added package 'BouncyCastle.1.8.6.1' to folder '{redacted}\packages'
    Added package 'BouncyCastle.1.8.6.1' to 'packages.config'
    Successfully installed 'BouncyCastle 1.8.6.1' to WindowsFormsAppFwk1
    Adding package 'System.Security.Principal.Windows.4.7.0' to folder '{redacted}\packages'
    Added package 'System.Security.Principal.Windows.4.7.0' to folder '{redacted}\packages'
    Added package 'System.Security.Principal.Windows.4.7.0' to 'packages.config'
    Successfully installed 'System.Security.Principal.Windows 4.7.0' to WindowsFormsAppFwk1
    Adding package 'System.Security.AccessControl.4.7.0' to folder '{redacted}\packages'
    Added package 'System.Security.AccessControl.4.7.0' to folder '{redacted}\packages'
    Added package 'System.Security.AccessControl.4.7.0' to 'packages.config'
    Successfully installed 'System.Security.AccessControl 4.7.0' to WindowsFormsAppFwk1
    Adding package 'System.Security.Permissions.4.7.0' to folder '{redacted}\packages'
    Added package 'System.Security.Permissions.4.7.0' to folder '{redacted}\packages'
    Added package 'System.Security.Permissions.4.7.0' to 'packages.config'
    Successfully installed 'System.Security.Permissions 4.7.0' to WindowsFormsAppFwk1
    Adding package 'System.Security.Cryptography.Xml.4.7.0' to folder '{redacted}\packages'
    Added package 'System.Security.Cryptography.Xml.4.7.0' to folder '{redacted}\packages'
    Added package 'System.Security.Cryptography.Xml.4.7.0' to 'packages.config'
    Successfully installed 'System.Security.Cryptography.Xml 4.7.0' to WindowsFormsAppFwk1
    Adding package 'NetLicensingClient-csharp.2.4.2' to folder '{redacted}\packages'
    Added package 'NetLicensingClient-csharp.2.4.2' to folder '{redacted}\packages'
    This reference cannot be removed from the project because it is always referenced by the compiler.
    This reference cannot be removed from the project because it is always referenced by the compiler.
    Added package 'NetLicensingClient-csharp.2.4.2' to 'packages.config'
    Successfully installed 'NetLicensingClient-csharp 2.4.2' to WindowsFormsAppFwk1
    Executing nuget actions took 25,54 sec
    Time Elapsed: 00:00:26.5739563
    ========== Finished ==========

Announce backward compatibility for the new release

NetLicensing C# Client will be aligned with the NetLicesing Clients reference implementation and might cause backward compatibility issues in the vendors' products.

This change needs to announced via version release description.

References:

NuGet package breaks .NET Core project

If you add NetLicensingClient 2.4.2 to a Windows Forms project targeting .NET Core, the project breaks somewhat. The Visual Studio designer is unable to show properties for any forms, components, controls etc. You can still compile, but you can't design your forms in the project that references NetLicensingClient.

When you add the package reference, you get a warning NU1701 concerning BouncyCastle:

Package 'BouncyCastle 1.8.6.1' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.1'. This package may not be fully compatible with your project.

This makes sense since NetLicensingClient is dependent on BouncyCastle and not BouncyCastle.NetCore. However, as noted in the previous issue, if you try to reference NetLicensingClient in a project that targets .NET Framework all hell breaks loose.

Product module number missing from validation response

According to the licensing model wiki pages, each validation response should include

  • productModuleNumber
  • productModuleName
  • licensingModel
  • valid

... in addition to any model-specific attributes.
However, productModuleNumber is missing from the response. The other three are there, but the module identity is not.

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.