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

Default URL constants should be public #11

Open
sschuberth opened this issue Aug 9, 2024 · 8 comments
Open

Default URL constants should be public #11

sschuberth opened this issue Aug 9, 2024 · 8 comments
Assignees

Comments

@sschuberth
Copy link

These are package-private but should be public:

static final String DEFAULT_SCAN_URL = "https://api.osskb.org/scan/direct"; // Free OSS OSSKB URL
static final String DEFAULT_SCAN_URL2 = "https://api.scanoss.com/scan/direct"; // Standard SCANOSS Premium URL

@sschuberth
Copy link
Author

What do you think, @scanossjeronimo?

@sschuberth
Copy link
Author

As a somewhat related note, IMO it's a bit weird that the "scan/direct" path is part of the default URL. Usually, the path is specific to the endpoint you're calling, see this code in ORT's own SCANOSS client. The only thing "special" here is that the API just has this single endpoint. But in preparation for eventually having more endpoints, probably only the base URL, without any path, should serve as the default URL.

@eeisegn
Copy link
Contributor

eeisegn commented Aug 13, 2024

@sschuberth We plan to have an abstract interface covering these (multiple) APIs in the future. For now we only implemented the ScanApi and as such put the full path into it.

Is there a reason you want to be able to have the DEFAULT_SCAN URLs public?
I assume you only need read access?

Also, there is the ability to supply the url field during instantiation. Does that satisfy the requirement?

@sschuberth
Copy link
Author

Is there a reason you want to be able to have the DEFAULT_SCAN URLs public?

We'd like to be able to fall back explicitly to it if no URL is specified in ORT, see this code.

@sschuberth
Copy link
Author

Also, there is the ability to supply the url field during instantiation. Does that satisfy the requirement?

Not sure if that's what you mean, but while I realize that we could simply not pass the URL to the builder / use an explicit null for the URL in order to make the default URL kick in, we prefer to be explicit about the default as part of the configuration.

@eeisegn
Copy link
Contributor

eeisegn commented Aug 13, 2024

OK. We'll prepare two new variables with public values for the base URL:

public static final String DEFAULT_BASE_URL = "https://api.osskb.org";

public static final String DEFAULT_BASE_URL2 = "https://api.scanoss.com";

Does this work for you?

@eeisegn
Copy link
Contributor

eeisegn commented Aug 13, 2024

Also, there is the ability to supply the url field during instantiation. Does that satisfy the requirement?

Not sure if that's what you mean, but while I realize that we could simply not pass the URL to the builder / use an explicit null for the URL in order to make the default URL kick in, we prefer to be explicit about the default as part of the configuration.

That field is optional in the builder, so if you won't have a value, you don't have to specify it. However, we will expose the default base path for you, so you can construct the URL.

@sschuberth
Copy link
Author

OK. We'll prepare two new variables with public values for the base URL:

Perfect, thanks!

ortizjeronimo added a commit that referenced this issue Dec 3, 2024
update download-artifact and update-artifact from v3 to v4 #11
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

No branches or pull requests

3 participants