Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API on Develop/V4 #1117

Open
perappu opened this issue Nov 9, 2024 · 6 comments
Open

API on Develop/V4 #1117

perappu opened this issue Nov 9, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@perappu
Copy link

perappu commented Nov 9, 2024

I started creating something on develop here using Laravel Sanctum, and wanted to gather some thoughts about it.

  • Is this something that should remain an extension, or built into LK?
  • Is this something that would be better targeted for develop or v4?

This is (potentially) my first feature contribution to upstream, so I'm not sure what has been planned or established thus far. Thanks!

@itinerare itinerare added the enhancement New feature or request label Nov 9, 2024
@itinerare
Copy link
Collaborator

itinerare commented Nov 9, 2024

iirc creation of an API was on the table (a long time ago) as a future feature plan and has to some degree been asked after in the past, so I think it'd be a good contender for inclusion. I think it makes sense too from a compatibility standpoint-- ext developers then can build on it if desired, for example.

If it's not breaking any existing functionality, I think v3.x is fine, probably. The definition of breaking change as-is is a bit weird, much like the rest of the project....

@perappu
Copy link
Author

perappu commented Nov 9, 2024

Neat, I'm happy to hear that!!

Only one thing that I can think of that might be a breaking change. I ran into an issue where failing the power:api_access check would return the entire HTML for the front page instead of a nice 401 or something. I wasn't able to track down where that redirect happens, so I'm guessing it's fairly deep?

Barring that, a few more questions come up...

  • Have there been any specific feature requests? What would we/users expect to come "pre-packaged" for the LK API?
  • Do we want it to be tied to staff powers/staff-only? This is how it is in my current proof-of-concept. Most relevant use cases I can think of are staff related, and tbh, the hardware most LK sites are run on probably wouldn't support a user-accessible API.

@itinerare
Copy link
Collaborator

I think most of the feature requests that I've run into are more on the user-facing end, tbh-- but I think you're probably right that it might cause more problems than it solves.

That said, to some degree it's fine if what's in initially is rather basic/groundwork that can be built on as need arises, so I wouldn't worry about getting everything in immediately.

@perappu
Copy link
Author

perappu commented Nov 9, 2024

Oh interesting... I'll focus on ironing out the basic authentication then, and we can build from there! 👍

@ScuffedNewt
Copy link
Contributor

Only one thing that I can think of that might be a breaking change. I ran into an issue where failing the power:api_access check would return the entire HTML for the front page instead of a nice 401 or something. I wasn't able to track down where that redirect happens, so I'm guessing it's fairly deep?

you need to use JSON responses instead of abort(CODE);

@perappu
Copy link
Author

perappu commented Nov 10, 2024

Only one thing that I can think of that might be a breaking change. I ran into an issue where failing the power:api_access check would return the entire HTML for the front page instead of a nice 401 or something. I wasn't able to track down where that redirect happens, so I'm guessing it's fairly deep?

you need to use JSON responses instead of abort(CODE);

Oh okay, I see now -- thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants