niksauer / serverless-software-license Goto Github PK
View Code? Open in Web Editor NEWSmart-contract and client library for the blockchain way of licensing
License: MIT License
Smart-contract and client library for the blockchain way of licensing
License: MIT License
Create a class called FileLicenseStorage
that implements the ILicenseStorage
interface (see interfaces/manager.ts
) by writing and reading the License
object to and from disk.
The class should accept a path at which the file is stored.
Please create a new folder for this class called storage
in the src/lib
directory.
Create a test case verifying that the getLicense
method throws if the disk contents don't match a License
.
Create a test case verifying that the setLicense
method throws if the contents to be written don't match a License
.
Create a test case verifying that the contents written to disk match those retrieved.
Search for a cross-platform compatible webcrypto shim to generate random data in a new getRandomData
utility function
Implement startRegister
by:
activeChallenge
instance propertycompleteRegister
by:verifyOwnership
in util.ts
)_isValid
property to true, emitting a LicenseManagerEvent.LicenseValidityChanged
event and resetting the activeChallenge
propertystartRegister
fails if the address has no license on the registrystartRegister
returns a random string if the address has a licensecompleteRegister
fails if the challenge response comes from a different addressLicenseManagerEvent.LicenseValidityChanged
event if the challenge response stems from the same address. Also, verify that the manager‘s public isValid
property has been set to falseLicenseManager
's checkValidity
method by:verifyOwnership
in src/lib/util.ts
)hasLicense
in src/lib/LicenseRegistry.ts
)_isValid
property according to the conditions metLicenseManagerEvent.LicenseValidityChanged
event if the _isValid
property changed compared to before calling this methodisValid
property returns a boolean in any caseisValid
property returns true if the conditions above are metisValid
property returns false if any of the conditions above aren't metA 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.