generated from oracle/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ben Selwyn-Smith <[email protected]>
- Loading branch information
Showing
8 changed files
with
287 additions
and
261 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,26 @@ | ||
# Copyright (c) 2023 - 2023, Oracle and/or its affiliates. All rights reserved. | ||
# Copyright (c) 2023 - 2024, Oracle and/or its affiliates. All rights reserved. | ||
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/. | ||
|
||
"""This package contains the dependency resolvers for Java projects.""" | ||
|
||
|
||
def to_domain_from_known_purl_types(purl_type: str) -> str | None: | ||
"""Return the git service domain from a known web-based purl type. | ||
This method is used to handle cases where the purl type value is not the git domain but a pre-defined | ||
repo-based type in https://github.com/package-url/purl-spec/blob/master/PURL-TYPES.rst. | ||
Note that this method will be updated when there are new pre-defined types as per the PURL specification. | ||
Parameters | ||
---------- | ||
purl_type : str | ||
The type field of the PURL. | ||
Returns | ||
------- | ||
str | None | ||
The git service domain corresponding to the purl type or None if the purl type is unknown. | ||
""" | ||
known_types = {"github": "github.com", "bitbucket": "bitbucket.org"} | ||
return known_types.get(purl_type, None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.