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

Define an accessor to get the Host of the endPoint of HTTPRunner #555

Open
k2tzumi opened this issue Jul 15, 2023 · 5 comments
Open

Define an accessor to get the Host of the endPoint of HTTPRunner #555

k2tzumi opened this issue Jul 15, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@k2tzumi
Copy link
Collaborator

k2tzumi commented Jul 15, 2023

For example, it allows access to

httpRunners['req'].endpoint.Host

We would like to use it in a use case that identifies the domain of the cookie object

@k1LoW
Copy link
Owner

k1LoW commented Jul 16, 2023

I have one question. Is this functionality necessary because the endpoint is set by environment variables, etc. and is not fixed to one?

In most cases, the endpoint should be known by the user executing the runn, so I am cautious about the need for this additional functionality.


I think httpRunners['req'].endpoint could be generalized as simply "allow access to the Runner's settings".

I am wondering if we should have access to the hostname in .Host or not.

Perhaps it would be better to make urlhostname() or url.Parse() a builtin-function.

@k1LoW k1LoW added the enhancement New feature or request label Jul 16, 2023
@k1LoW
Copy link
Owner

k1LoW commented Jul 16, 2023

I think httpRunners['req'].endpoint could be generalized as simply "allow access to the Runner's settings".

I think httpRunners['req'].endpoint would be easier to understand if it were a string entered by the user instead of *url.URL.

@k2tzumi
Copy link
Collaborator Author

k2tzumi commented Jul 16, 2023

Perhaps it would be better to make urlhostname() or url.Parse() a builtin-function.

The url function was incorporated and implemented.
#556 (comment)

Some redundancy remained in the area of including default values for environment variables.

I am wondering if we should have access to the hostname in .Host or not.

https://vscode.dev/github/k1LoW/runn/blob/vulnerability-check/http.go#L47

The current httpRunner was carrying it around as a url, so I was thinking of putting it directly into the store.

@k1LoW
Copy link
Owner

k1LoW commented Jul 16, 2023

The url function was incorporated and implemented.
#556 (comment)

👍 Thank you!

Some redundancy remained in the area of including default values for environment variables.

I am wondering if this redundancy is acceptable.

The current httpRunner was carrying it around as a url, so I was thinking of putting it directly into the store.

I think that is fine if we only consider the endpoint 👍

However, if we were to add this functionality, I would want to raise the level of abstraction in the form of "access to Runner's settings".

At this point, it is debatable whether the parsed value should be set or not.

For example, we need to consider the following values.

  • endpoint of HTTP Runner
  • openapi3 of HTTP Runner
  • key of gRPC Runner
  • protos of gRPC Runner

@k2tzumi
Copy link
Collaborator Author

k2tzumi commented Jul 17, 2023

I am wondering if this redundancy is acceptable.

This use case is necessary when sending cookies, but if automatic cookie sending is supported as the next extension, the priority will be lowered.

However, if we were to add this functionality, I would want to raise the level of abstraction in the form of "access to Runner's settings".

Agreed.
As we see other use cases, let's consider interfaces that can be handled in a unified manner.

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

2 participants