question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Object-oriented API for 3.0

See original GitHub issue

The current API does not make it clear that certain configuration options must be provided to both token generation and verification functions. I would like to suggest changing the API to capture the configuration state in an API class instance, rather than the current function-based approach.

  • New classes: HOTP and TOTP.
  • Default instances with recommended quick-start configurations.
  • As this is a breaking change, either move legacy API to compat module or remove entirely.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
mikepbcommented, Feb 28, 2017

Pure JS prototypical inheritance is tricky. Most people are unfamiliar with it. ES6 introduces the more traditional class inheritance pattern. We can take advantage of Babel to write the new module using ES6.

I agree that a new module would be most appropriate. For lack of a better name, I’ll give it the code name of libotp.

On Feb 28, 2017, at 4:10 AM, Connie Leung notifications@github.com wrote:

I am not proficient in OO JS and not sure what inheritance pattern. I can look it up. I think a new module should be used for version 3.0. So speakeasy should be used for v1 and v2 only.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

0reactions
railsstudentcommented, Mar 2, 2017

@mikepb If use ES6/Babel/class, tools such as webpack/gulp may be need3ed for trancompilation. That should be consider for build process.

@mikepb i have never led in project before and api design is not my strength. i can learn on the side.

Read more comments on GitHub >

github_iconTop Results From Across the Web

OpenAPI Specification - Version 3.0.3 - Swagger
The OpenAPI Specification defines a standard interface to RESTful APIs which allows both humans and computers to understand service capabilities without ...
Read more >
OpenAPI Specification v3.0.0 | Introduction, Definitions, & More
The OpenAPI Specification (OAS) defines a standard, programming language-agnostic interface description for HTTP APIs.
Read more >
Generating an OpenAPI 3.0 Document for sObjects REST API ...
Accesses records based on the specified object ID. Retrieves, updates, or deletes records. Can retrieve field values. Use the GET method to retrieve...
Read more >
OpenAPI 3.0 Tutorial | SwaggerHub Documentation
OpenAPI 3.0 is an open-source format for describing and documenting APIs. In this tutorial, we will write a simple API definition in the ......
Read more >
OpenAPI 3.0: How to Design and Document APIs ... - YouTube
The OpenAPI Specification (OAS), based on the original Swagger 2.0 specification, has emerged as the world's standard for defining and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found