Comments (5)
I'd like to throw an Error in the code, and not rely on the TypeScript definitions. hen using the auth strategy with Octokit, the octokit.auth()
method does currently not inherit the types
from auth-app.js.
at TS level does not have much sense since an invalid type is impossible to reach when using
@octokit/auth-app
package.
That is a known limitation right now. See octokit/core.js#32 and https://github.com/octokit/rest.js/issues/1562#issuecomment-582678977. It comes back to the idea of having a global Octokit
namespace that plugins can extend, it's a bigger project. I want to create a high level issue for this for further discussion. This will also address the ability to define custom event webhooks, for example
from auth-app.js.
Hi @gr2m
Taking a look into this.
Trying to reproduce it with TypeScript, the compiler complains about it:
https://codesandbox.io/s/octokit-auth-app-with-typo-lsg69
Do you have more details on how to reproduce this?
from auth-app.js.
Drafted this PR (#249) but at TS level does not have much sense since an invalid type is impossible to reach when using @octokit/auth-app
package.
Checking at @octokit/core
package, I found some TODO
s which probably are the cause of the problem:
- https://github.com/octokit/core.js/blob/8d694c00a3a44c61c2fbb4d88e49e4a2d33fb50c/src/types.ts#L8-L11
- https://github.com/octokit/core.js/blob/8d694c00a3a44c61c2fbb4d88e49e4a2d33fb50c/src/index.ts#L119-L123
- https://github.com/octokit/core.js/blob/8d694c00a3a44c61c2fbb4d88e49e4a2d33fb50c/src/index.ts#L180-L181
And checking at @octokit/types
seems we are not exposing AuthTypes. What we would need is:
Lines 141 to 144 in f008655
Not sure how to proceed here:
- To place
AuthOptions
in@octokit/types
(and@octokit/auth-app
and@octokit/core
consume them from there) (?) - To add
@octokit/auth-app
as dependency for@octokit/core
and consumeAuthOptions
directly (?) - Any other option I'm not considering (?)
from auth-app.js.
🎉 This issue has been resolved in version 2.11.0 🎉
The release is available on:
Your semantic-release bot 📦🚀
from auth-app.js.
Related Issues (20)
- [FEAT]: When will the conversion to ESM happen? HOT 1
- Getting the correct `installation_id` to use HOT 5
- [BUG]: secretOrPrivateKey size error when size is larger enough HOT 4
- Backed authentication user-to-server without device flow
- [BUG]: ReferenceError: Property 'atob' doesn't exist HOT 9
- [BUG]: secretOrPrivateKey must be an asymmetric key when using RS256 HOT 28
- [BUG]: package files not published to npm HOT 1
- [BUG]: unable to use this package with `@actions/github-script` HOT 19
- [DOCS]: Node version requirements HOT 3
- Replace `toMatchObject` Response assertions with `toEqual` in `auth-app.js` HOT 1
- [DOCS]: Implementation of GitHub App user authentication token with expiring disabled HOT 6
- [BUG]: Cache#get type doesn't allow promises HOT 2
- [BUG]: Upgrade universal-github-app-jwt 1.1.2 to close CVE-2022-25883 HOT 5
- Default flow results in error for missing installationId HOT 5
- [BUG]: `octokit.request("PATCH /app/hook/config", { url })` throws error `installationId option is required for installation authentication` HOT 1
- [BUG]: Handle 403 responses same as 401 responses in the first 3 seconds after an installation access token was created HOT 1
- [BUG]: /app/installation-requests missing from PATHS in requires-app-auth HOT 3
- Revisit skipped tests HOT 1
- `appId` can now be set to the application's Client ID HOT 2
- [MAINT]: use stable `semantic-release` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from auth-app.js.