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

Bring Method and StatusCode types from http-types into typespec #1937

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

joonas
Copy link

@joonas joonas commented Nov 28, 2024

I was hoping to be able to get rid of the http-types crate given that it's not actively being updated and one of the dependencies of it's dependencies has an outstanding RUSTSEC advisory (RUSTSEC-2024-0384).

Since typespec and typespec_client_core are only making use of the Method and StatusCode types, I thought bringing them into the typescript crate and using them from there seemed appropriate.

Closes #1644

@joonas
Copy link
Author

joonas commented Nov 28, 2024

@microsoft-github-policy-service agree

@joonas
Copy link
Author

joonas commented Nov 28, 2024

It looks like the analyze job doesn't like the HTTP methods CHECKIN or MKACTIVITY, should the be added to a dictionary somewhere?

Copy link
Member

@heaths heaths left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are licensing issues that need to be addressed first. All three projects from where files were copied are dual-licensed under an MIT license so, at the very least, we need to attribute them. These also shouldn't be in the typespec crate but under typespec_client_core:http. We could move them down the stack later, but we can never move them up the stack (after GA, anyway). Better to start further down the stack, which is why typespec only has error types right now.

I'll make some changes to this as it would probably be easier, but I can start with what you have here. Thank you.

@heaths heaths changed the title chore: Bring Method and StatusCode types from http-types into typespec Bring Method and StatusCode types from http-types into typespec Dec 2, 2024
@joonas
Copy link
Author

joonas commented Dec 2, 2024

@heaths that sounds great, at the end of the day my main concern here is to be able to address RUSTSEC-2024-0384 as a consumer of these libraries.

@heaths
Copy link
Member

heaths commented Dec 2, 2024

I appreciate that, but it seems a lot of crates are unmaintained. What happens when http falls out of maintenance? We may need to consider vendoring instead. Maybe we're not there with this small change (2 types) yet, but once we hit GA we have a strict* no-breaking-changes policy.

/cc @RickWinter @JeffreyRichter @ronniegeraghty

*) Well, mostly strict. For Rust, as opposed to most of our other languages, client APIs may break due to service REST API approved breaks but we'll also shipping 1:1 crate version:service API version.

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

Successfully merging this pull request may close these issues.

Consider replacing http-types crate with http crate
2 participants