feat: [AH-994]: Updated Client setup details. Update pypi to python (#3547)

* Merge branch 'main' of https://git0.harness.io/l7B_kbSEQD2wjrM7PShm5w/PROD/Harness_Commons/gitness into AH-994-client-setup-details-update
* [AH-994]: Merge conflict fixed
* [AH-994]: Merge conflict fixed
* [AH-994]: Updated makefile
* [AH-994]: Merge conflict fixed
* [AH-994]: Updated Client setup details. Update pypi to python
try-new-ui
Arvind Choudhary 2025-03-13 04:45:55 +00:00 committed by Harness
parent 32196d481f
commit f660d8b0cd
21 changed files with 229 additions and 260 deletions

View File

@ -60,7 +60,7 @@ run: ar-clean build
ar-conformance-test: ar-clean build
./gitness server .local.env > logfile.log 2>&1 & echo $$! > server.PID
@sleep 10
@sleep 20
./registry/tests/conformance_test.sh localhost:3000
EXIT_CODE=$$?;
kill `cat server.PID`

View File

@ -25,7 +25,10 @@ import (
gitnessenum "github.com/harness/gitness/types/enum"
)
func ResolveSecret(ctx context.Context, secretResolverFactory *secret.ResolverFactory, config types.GitspaceConfig) (*string, error) {
func ResolveSecret(ctx context.Context, secretResolverFactory *secret.ResolverFactory, config types.GitspaceConfig) (
*string,
error,
) {
rootSpaceID, _, err := paths.DisectRoot(config.SpacePath)
if err != nil {
return nil, fmt.Errorf("unable to find root space id from space path: %s", config.SpacePath)

View File

@ -44,6 +44,7 @@ func (s *Service) List(
if err != nil {
return nil, 0, err
}
case enum.WebhookParentRegistry:
default:
return nil, 0, fmt.Errorf("webhook type %s is not supported", parentType)
}

View File

@ -134,6 +134,7 @@ func (s *WebhookStore) FindByIdentifier(
stmt = stmt.Where("webhook_repo_id = ?", parentID)
case enum.WebhookParentSpace:
stmt = stmt.Where("webhook_space_id = ?", parentID)
case enum.WebhookParentRegistry:
default:
return nil, fmt.Errorf("webhook parent type '%s' is not supported", parentType)
}
@ -329,6 +330,7 @@ func (s *WebhookStore) DeleteByIdentifier(
stmt = stmt.Where("webhook_repo_id = ?", parentID)
case enum.WebhookParentSpace:
stmt = stmt.Where("webhook_space_id = ?", parentID)
case enum.WebhookParentRegistry:
default:
return fmt.Errorf("webhook parent type '%s' is not supported", parentType)
}
@ -503,6 +505,7 @@ func mapToInternalWebhook(hook *types.Webhook) (*webhook, error) {
res.RepoID = null.IntFrom(hook.ParentID)
case enum.WebhookParentSpace:
res.SpaceID = null.IntFrom(hook.ParentID)
case enum.WebhookParentRegistry:
default:
return nil, fmt.Errorf("webhook parent type %q is not supported", hook.ParentType)
}
@ -581,6 +584,7 @@ func selectWebhookParents(
parentSelector = append(parentSelector, squirrel.Eq{
"webhook_space_id": parent.ID,
})
case enum.WebhookParentRegistry:
default:
return fmt.Errorf("webhook parent type '%s' is not supported", parent.Type)
}

View File

@ -24,6 +24,8 @@ import (
"strings"
"github.com/harness/gitness/app/paths"
"github.com/rs/zerolog/log"
)
const (
@ -78,7 +80,7 @@ type Provider interface {
GetAPIProto(ctx context.Context) string
RegistryURL(ctx context.Context, params ...string) string
PackageURL(ctx context.Context, params ...string) string
GetUIBaseURL(ctx context.Context, params ...string) string
// GenerateUIRegistryURL returns the url for the UI screen of a registry.
@ -257,6 +259,21 @@ func (p *provider) RegistryURL(_ context.Context, params ...string) string {
return strings.TrimRight(u.String(), "/")
}
func (p *provider) PackageURL(_ context.Context, params ...string) string {
u, err := url.Parse(p.registryURL.String())
if err != nil {
log.Warn().Msgf("failed to parse registry url: %v", err)
return p.registryURL.String()
}
segments := []string{u.Path}
segments = append(segments, "pkg")
segments = append(segments, params...)
fullPath := path.Join(segments...)
u.Path = fullPath
return strings.TrimRight(u.String(), "/")
}
func (p *provider) GetUIBaseURL(_ context.Context, _ ...string) string {
return p.uiURL.String()
}

View File

@ -121,8 +121,8 @@ func toPackageType(packageTypeStr string) (artifactapi.PackageType, error) {
return artifactapi.PackageTypeHELM, nil
case string(artifactapi.PackageTypeMAVEN):
return artifactapi.PackageTypeMAVEN, nil
case string(artifactapi.PackageTypePYPI):
return artifactapi.PackageTypePYPI, nil
case string(artifactapi.PackageTypePYTHON):
return artifactapi.PackageTypePYTHON, nil
default:
return "", errors.New("invalid package type")
}

View File

@ -332,7 +332,8 @@ func (c *APIController) CreateUpstreamProxyEntity(
}
if res.SecretSpacePath != nil && len(*res.SecretSpacePath) > 0 {
upstreamProxyConfigEntity.SecretSpaceID, err = c.RegistryMetadataHelper.getSecretSpaceID(ctx, res.SecretSpacePath)
upstreamProxyConfigEntity.SecretSpaceID, err = c.RegistryMetadataHelper.getSecretSpaceID(ctx,
res.SecretSpacePath)
if err != nil {
return nil, nil, err
}
@ -365,7 +366,8 @@ func (c *APIController) CreateUpstreamProxyEntity(
}
if res.SecretKeySpacePath != nil && len(*res.SecretKeySpacePath) > 0 {
upstreamProxyConfigEntity.SecretSpaceID, err = c.RegistryMetadataHelper.getSecretSpaceID(ctx, res.SecretKeySpacePath)
upstreamProxyConfigEntity.SecretSpaceID, err = c.RegistryMetadataHelper.getSecretSpaceID(ctx,
res.SecretKeySpacePath)
if err != nil {
return nil, nil, err
}
@ -377,19 +379,6 @@ func (c *APIController) CreateUpstreamProxyEntity(
return repoEntity, upstreamProxyConfigEntity, nil
}
func (c *APIController) getSecretSpaceID(ctx context.Context, secretSpacePath *string) (int, error) {
if secretSpacePath == nil {
return -1, fmt.Errorf("secret space path is missing")
}
space, err := c.SpaceFinder.FindByRef(ctx, *secretSpacePath)
if err != nil {
return -1, fmt.Errorf("failed to get Space Path: %w", err)
}
return int(space.ID), nil
}
func isDuplicateKeyError(err error) bool {
return strings.Contains(err.Error(), "resource is a duplicate")
}

View File

@ -35,7 +35,9 @@ func (c *APIController) CreateWebhook(
) (api.CreateWebhookResponseObject, error) {
webhookRequest := api.WebhookRequest(*r.Body)
if webhookRequest.Identifier == internalWebhookIdentifier {
return createWebhookBadRequestErrorResponse(fmt.Errorf("webhook identifier %s is reserved", internalWebhookIdentifier))
return createWebhookBadRequestErrorResponse(
fmt.Errorf("webhook identifier %s is reserved", internalWebhookIdentifier),
)
}
regInfo, err := c.RegistryMetadataHelper.GetRegistryRequestBaseInfo(ctx, "", string(r.RegistryRef))
if err != nil {

View File

@ -17,6 +17,7 @@ package metadata
import (
"context"
"net/http"
"net/url"
"strings"
apiauth "github.com/harness/gitness/app/api/auth"
@ -71,37 +72,6 @@ func (c *APIController) GetClientSetupDetails(
}, err
}
//nolint:nestif
if imageParam != nil {
image, err := c.ImageStore.GetByName(ctx, reg.ID, string(*imageParam))
if err != nil {
return artifact.GetClientSetupDetails404JSONResponse{
NotFoundJSONResponse: artifact.NotFoundJSONResponse(
*GetErrorResponse(http.StatusNotFound, "image doesn't exist"),
),
}, err
}
if reg.PackageType != artifact.PackageTypeDOCKER && reg.PackageType != artifact.PackageTypeHELM && tagParam != nil {
_, err := c.ArtifactStore.GetByName(ctx, image.ID, string(*tagParam))
if err != nil {
return artifact.GetClientSetupDetails404JSONResponse{
NotFoundJSONResponse: artifact.NotFoundJSONResponse(
*GetErrorResponse(http.StatusNotFound, "tag doesn't exist"),
),
}, err
}
} else if tagParam != nil {
_, err := c.TagStore.FindTag(ctx, reg.ID, string(*imageParam), string(*tagParam))
if err != nil {
return artifact.GetClientSetupDetails404JSONResponse{
NotFoundJSONResponse: artifact.NotFoundJSONResponse(
*GetErrorResponse(http.StatusNotFound, "tag doesn't exist"),
),
}, err
}
}
}
packageType := string(reg.PackageType)
return artifact.GetClientSetupDetails200JSONResponse{
@ -132,8 +102,8 @@ func (c *APIController) GenerateClientSetupDetails(
loginPasswordLabel, username, registryRef, image, tag)
case string(artifact.PackageTypeGENERIC):
return c.generateGenericClientSetupDetail(ctx, blankString, registryRef, image, tag)
case string(artifact.PackageTypePYPI):
return c.generatePyPIClientSetupDetail(ctx, registryRef, username, image, tag)
case string(artifact.PackageTypePYTHON):
return c.generatePythonClientSetupDetail(ctx, registryRef, username, image, tag)
}
header1 := "Login to Docker"
section1step1Header := "Run this Docker command in your terminal to authenticate the client."
@ -738,7 +708,7 @@ func (c *APIController) generateMavenClientSetupDetail(
}
}
func (c *APIController) generatePyPIClientSetupDetail(
func (c *APIController) generatePythonClientSetupDetail(
ctx context.Context,
registryRef string,
username string,
@ -750,7 +720,7 @@ func (c *APIController) generatePyPIClientSetupDetail(
// Authentication section
section1 := artifact.ClientSetupSection{
Header: stringPtr("1. Configure Authentication"),
Header: stringPtr("Configure Authentication"),
}
_ = section1.FromClientSetupStepConfig(artifact.ClientSetupStepConfig{
Steps: &[]artifact.ClientSetupStep{
@ -762,9 +732,9 @@ func (c *APIController) generatePyPIClientSetupDetail(
Value: stringPtr("[distutils]\n" +
"index-servers = harness\n\n" +
"[harness]\n" +
"repository: <REGISTRY_URL>/<REGISTRY_NAME>\n" +
"username: <USERNAME>\n" +
"password: {{identity-token}}"),
"repository = <REGISTRY_URL>\n" +
"username = <USERNAME>\n" +
"password = *see step 2*"),
},
},
},
@ -775,29 +745,11 @@ func (c *APIController) generatePyPIClientSetupDetail(
},
})
// Install section
// Publish section
section2 := artifact.ClientSetupSection{
Header: stringPtr("2. Install Package"),
Header: stringPtr("Publish Package"),
}
_ = section2.FromClientSetupStepConfig(artifact.ClientSetupStepConfig{
Steps: &[]artifact.ClientSetupStep{
{
Header: stringPtr("Install a package using pip:"),
Type: &staticStepType,
Commands: &[]artifact.ClientSetupStepCommand{
{
Value: stringPtr("pip install --index-url <REGISTRY_URL>/<REGISTRY_NAME> <PACKAGE_NAME>==<VERSION>"),
},
},
},
},
})
// Publish section
section3 := artifact.ClientSetupSection{
Header: stringPtr("3. Publish Package"),
}
_ = section3.FromClientSetupStepConfig(artifact.ClientSetupStepConfig{
Steps: &[]artifact.ClientSetupStep{
{
Header: stringPtr("Build and publish your package:"),
@ -807,7 +759,25 @@ func (c *APIController) generatePyPIClientSetupDetail(
Value: stringPtr("python -m build"),
},
{
Value: stringPtr("python -m twine upload --repository harness dist/*"),
Value: stringPtr("python -m twine upload --repository harness /path/to/files/*"),
},
},
},
},
})
// Install section
section3 := artifact.ClientSetupSection{
Header: stringPtr("Install Package"),
}
_ = section3.FromClientSetupStepConfig(artifact.ClientSetupStepConfig{
Steps: &[]artifact.ClientSetupStep{
{
Header: stringPtr("Install a package using pip:"),
Type: &staticStepType,
Commands: &[]artifact.ClientSetupStepCommand{
{
Value: stringPtr("pip install --index-url <UPLOAD_URL>/simple --no-deps <ARTIFACT_NAME>==<VERSION>"),
},
},
},
@ -815,7 +785,7 @@ func (c *APIController) generatePyPIClientSetupDetail(
})
clientSetupDetails := artifact.ClientSetupDetails{
MainHeader: "PyPI Client Setup",
MainHeader: "Python Client Setup",
SecHeader: "Follow these instructions to install/use Python packages from this registry.",
Sections: []artifact.ClientSetupSection{
section1,
@ -824,10 +794,10 @@ func (c *APIController) generatePyPIClientSetupDetail(
},
}
rootSpace, _, _ := paths.DisectRoot(registryRef)
registryURL := c.URLProvider.RegistryURL(ctx, "pypi", rootSpace)
registryURL := c.URLProvider.PackageURL(ctx, registryRef, "python")
c.replacePlaceholders(ctx, &clientSetupDetails.Sections, username, registryRef, image, tag, registryURL, "", "pypi")
c.replacePlaceholders(ctx, &clientSetupDetails.Sections, username, registryRef, image, tag, registryURL, "",
string(artifact.PackageTypePYTHON))
return &artifact.ClientSetupDetailsResponseJSONResponse{
Data: clientSetupDetails,
@ -846,15 +816,23 @@ func (c *APIController) replacePlaceholders(
groupID string,
pkgType string,
) {
uploadURL := ""
if pkgType == string(artifact.PackageTypePYTHON) {
regURL, _ := url.Parse(registryURL)
// append username:password to the host
regURL.User = url.UserPassword(username, "identity-token")
uploadURL = regURL.String()
}
for i := range *clientSetupSections {
tab, err := (*clientSetupSections)[i].AsTabSetupStepConfig()
if err != nil || tab.Tabs == nil {
//nolint:lll
c.replacePlaceholdersInSection(ctx, &(*clientSetupSections)[i], username, regRef, image, tag, pkgType,
groupID, registryURL)
registryURL, groupID, uploadURL)
} else {
for j := range *tab.Tabs {
c.replacePlaceholders(ctx, (*tab.Tabs)[j].Sections, username, regRef, image, tag, groupID, registryURL,
c.replacePlaceholders(ctx, (*tab.Tabs)[j].Sections, username, regRef, image, tag, registryURL, groupID,
pkgType)
}
_ = (*clientSetupSections)[i].FromTabSetupStepConfig(tab)
@ -872,6 +850,7 @@ func (c *APIController) replacePlaceholdersInSection(
pkgType string,
registryURL string,
groupID string,
uploadURL string,
) {
rootSpace, _, _ := paths.DisectRoot(regRef)
_, registryName, _ := paths.DisectLeaf(regRef)
@ -891,7 +870,7 @@ func (c *APIController) replacePlaceholdersInSection(
continue
}
for j := range *st.Commands {
replaceText(username, st, j, hostname, registryName, image, tag, registryURL, groupID)
replaceText(username, st, j, hostname, registryName, image, tag, registryURL, groupID, uploadURL)
}
}
_ = clientSetupSection.FromClientSetupStepConfig(sec)
@ -907,6 +886,7 @@ func replaceText(
tag *artifact.VersionParam,
registryURL string,
groupID string,
uploadURL string,
) {
if username != "" {
(*st.Commands)[i].Value = stringPtr(strings.ReplaceAll(*(*st.Commands)[i].Value, "<USERNAME>", username))
@ -920,6 +900,9 @@ func replaceText(
if registryURL != "" {
(*st.Commands)[i].Value = stringPtr(strings.ReplaceAll(*(*st.Commands)[i].Value, "<REGISTRY_URL>", registryURL))
}
if uploadURL != "" {
(*st.Commands)[i].Value = stringPtr(strings.ReplaceAll(*(*st.Commands)[i].Value, "<UPLOAD_URL>", uploadURL))
}
if hostname != "" {
(*st.Commands)[i].Value = stringPtr(strings.ReplaceAll(*(*st.Commands)[i].Value, "<HOSTNAME>", hostname))
}

View File

@ -170,6 +170,7 @@ func mapTpAPIExecutionResult(result enum.WebhookExecutionResult) api.WebhookExec
return ""
}
//nolint:exhaustive
func mapTpAPITriggerType(trigger enum.WebhookTrigger) api.Trigger {
switch trigger {
case enum.WebhookTriggerArtifactCreated:

View File

@ -115,7 +115,7 @@ var validPackageTypes = []string{
string(a.PackageTypeHELM),
string(a.PackageTypeGENERIC),
string(a.PackageTypeMAVEN),
string(a.PackageTypePYPI),
string(a.PackageTypePYTHON),
}
var validUpstreamSources = []string{

View File

@ -83,13 +83,13 @@ type PathPackageType string
const (
PathPackageTypeGeneric PathPackageType = "generic"
PathPackageTypeMaven PathPackageType = "maven"
PathPackageTypePyPI PathPackageType = "pypi"
PathPackageTypePython PathPackageType = "python"
)
var packageTypeMap = map[PathPackageType]artifact2.PackageType{
PathPackageTypeGeneric: artifact2.PackageTypeGENERIC,
PathPackageTypeMaven: artifact2.PackageTypeMAVEN,
PathPackageTypePyPI: artifact2.PackageTypePYPI,
PathPackageTypePython: artifact2.PackageTypePYTHON,
}
func (h *handler) GetAuthenticator() authn.Authenticator {

View File

@ -1749,13 +1749,13 @@ components:
HELM: "#/components/schemas/HelmArtifactDetailConfig"
GENERIC: "#/components/schemas/GenericArtifactDetailConfig"
MAVEN: "#/components/schemas/MavenArtifactDetailConfig"
PYPI: "#/components/schemas/PyPiArtifactDetailConfig"
PYTHON: "#/components/schemas/PythonArtifactDetailConfig"
oneOf:
- $ref: "#/components/schemas/DockerArtifactDetailConfig"
- $ref: "#/components/schemas/HelmArtifactDetailConfig"
- $ref: "#/components/schemas/GenericArtifactDetailConfig"
- $ref: "#/components/schemas/MavenArtifactDetailConfig"
- $ref: "#/components/schemas/PyPiArtifactDetailConfig"
- $ref: "#/components/schemas/PythonArtifactDetailConfig"
required:
- imageName
- version
@ -1782,9 +1782,9 @@ components:
type: string
artifactId:
type: string
PyPiArtifactDetailConfig:
PythonArtifactDetailConfig:
type: object
description: Config for pypi artifact details
description: Config for python artifact details
properties:
groupId:
type: string
@ -2196,7 +2196,7 @@ components:
enum:
- DOCKER
- MAVEN
- PYPI
- PYTHON
- GENERIC
- HELM
SectionType:

View File

@ -1,6 +1,6 @@
// Package artifact provides primitives to interact with the openapi HTTP API.
//
// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.0 DO NOT EDIT.
// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.
package artifact
import (
@ -346,7 +346,6 @@ type MiddlewareFunc func(http.Handler) http.Handler
// CreateRegistry operation middleware
func (siw *ServerInterfaceWrapper) CreateRegistry(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
@ -369,12 +368,11 @@ func (siw *ServerInterfaceWrapper) CreateRegistry(w http.ResponseWriter, r *http
handler = middleware(handler)
}
handler.ServeHTTP(w, r.WithContext(ctx))
handler.ServeHTTP(w, r)
}
// DeleteRegistry operation middleware
func (siw *ServerInterfaceWrapper) DeleteRegistry(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
@ -395,12 +393,11 @@ func (siw *ServerInterfaceWrapper) DeleteRegistry(w http.ResponseWriter, r *http
handler = middleware(handler)
}
handler.ServeHTTP(w, r.WithContext(ctx))
handler.ServeHTTP(w, r)
}
// GetRegistry operation middleware
func (siw *ServerInterfaceWrapper) GetRegistry(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
@ -421,12 +418,11 @@ func (siw *ServerInterfaceWrapper) GetRegistry(w http.ResponseWriter, r *http.Re
handler = middleware(handler)
}
handler.ServeHTTP(w, r.WithContext(ctx))
handler.ServeHTTP(w, r)
}
// ModifyRegistry operation middleware
func (siw *ServerInterfaceWrapper) ModifyRegistry(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
@ -447,12 +443,11 @@ func (siw *ServerInterfaceWrapper) ModifyRegistry(w http.ResponseWriter, r *http
handler = middleware(handler)
}
handler.ServeHTTP(w, r.WithContext(ctx))
handler.ServeHTTP(w, r)
}
// ListArtifactLabels operation middleware
func (siw *ServerInterfaceWrapper) ListArtifactLabels(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
@ -500,12 +495,11 @@ func (siw *ServerInterfaceWrapper) ListArtifactLabels(w http.ResponseWriter, r *
handler = middleware(handler)
}
handler.ServeHTTP(w, r.WithContext(ctx))
handler.ServeHTTP(w, r)
}
// GetArtifactStatsForRegistry operation middleware
func (siw *ServerInterfaceWrapper) GetArtifactStatsForRegistry(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
@ -545,12 +539,11 @@ func (siw *ServerInterfaceWrapper) GetArtifactStatsForRegistry(w http.ResponseWr
handler = middleware(handler)
}
handler.ServeHTTP(w, r.WithContext(ctx))
handler.ServeHTTP(w, r)
}
// DeleteArtifact operation middleware
func (siw *ServerInterfaceWrapper) DeleteArtifact(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
@ -580,12 +573,11 @@ func (siw *ServerInterfaceWrapper) DeleteArtifact(w http.ResponseWriter, r *http
handler = middleware(handler)
}
handler.ServeHTTP(w, r.WithContext(ctx))
handler.ServeHTTP(w, r)
}
// UpdateArtifactLabels operation middleware
func (siw *ServerInterfaceWrapper) UpdateArtifactLabels(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
@ -615,12 +607,11 @@ func (siw *ServerInterfaceWrapper) UpdateArtifactLabels(w http.ResponseWriter, r
handler = middleware(handler)
}
handler.ServeHTTP(w, r.WithContext(ctx))
handler.ServeHTTP(w, r)
}
// GetArtifactStats operation middleware
func (siw *ServerInterfaceWrapper) GetArtifactStats(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
@ -669,12 +660,11 @@ func (siw *ServerInterfaceWrapper) GetArtifactStats(w http.ResponseWriter, r *ht
handler = middleware(handler)
}
handler.ServeHTTP(w, r.WithContext(ctx))
handler.ServeHTTP(w, r)
}
// GetArtifactSummary operation middleware
func (siw *ServerInterfaceWrapper) GetArtifactSummary(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
@ -704,12 +694,11 @@ func (siw *ServerInterfaceWrapper) GetArtifactSummary(w http.ResponseWriter, r *
handler = middleware(handler)
}
handler.ServeHTTP(w, r.WithContext(ctx))
handler.ServeHTTP(w, r)
}
// DeleteArtifactVersion operation middleware
func (siw *ServerInterfaceWrapper) DeleteArtifactVersion(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
@ -748,12 +737,11 @@ func (siw *ServerInterfaceWrapper) DeleteArtifactVersion(w http.ResponseWriter,
handler = middleware(handler)
}
handler.ServeHTTP(w, r.WithContext(ctx))
handler.ServeHTTP(w, r)
}
// GetArtifactDetails operation middleware
func (siw *ServerInterfaceWrapper) GetArtifactDetails(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
@ -803,12 +791,11 @@ func (siw *ServerInterfaceWrapper) GetArtifactDetails(w http.ResponseWriter, r *
handler = middleware(handler)
}
handler.ServeHTTP(w, r.WithContext(ctx))
handler.ServeHTTP(w, r)
}
// GetDockerArtifactDetails operation middleware
func (siw *ServerInterfaceWrapper) GetDockerArtifactDetails(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
@ -865,12 +852,11 @@ func (siw *ServerInterfaceWrapper) GetDockerArtifactDetails(w http.ResponseWrite
handler = middleware(handler)
}
handler.ServeHTTP(w, r.WithContext(ctx))
handler.ServeHTTP(w, r)
}
// GetDockerArtifactLayers operation middleware
func (siw *ServerInterfaceWrapper) GetDockerArtifactLayers(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
@ -927,12 +913,11 @@ func (siw *ServerInterfaceWrapper) GetDockerArtifactLayers(w http.ResponseWriter
handler = middleware(handler)
}
handler.ServeHTTP(w, r.WithContext(ctx))
handler.ServeHTTP(w, r)
}
// GetDockerArtifactManifest operation middleware
func (siw *ServerInterfaceWrapper) GetDockerArtifactManifest(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
@ -989,12 +974,11 @@ func (siw *ServerInterfaceWrapper) GetDockerArtifactManifest(w http.ResponseWrit
handler = middleware(handler)
}
handler.ServeHTTP(w, r.WithContext(ctx))
handler.ServeHTTP(w, r)
}
// GetDockerArtifactManifests operation middleware
func (siw *ServerInterfaceWrapper) GetDockerArtifactManifests(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
@ -1033,12 +1017,11 @@ func (siw *ServerInterfaceWrapper) GetDockerArtifactManifests(w http.ResponseWri
handler = middleware(handler)
}
handler.ServeHTTP(w, r.WithContext(ctx))
handler.ServeHTTP(w, r)
}
// GetArtifactFiles operation middleware
func (siw *ServerInterfaceWrapper) GetArtifactFiles(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
@ -1120,12 +1103,11 @@ func (siw *ServerInterfaceWrapper) GetArtifactFiles(w http.ResponseWriter, r *ht
handler = middleware(handler)
}
handler.ServeHTTP(w, r.WithContext(ctx))
handler.ServeHTTP(w, r)
}
// GetHelmArtifactDetails operation middleware
func (siw *ServerInterfaceWrapper) GetHelmArtifactDetails(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
@ -1164,12 +1146,11 @@ func (siw *ServerInterfaceWrapper) GetHelmArtifactDetails(w http.ResponseWriter,
handler = middleware(handler)
}
handler.ServeHTTP(w, r.WithContext(ctx))
handler.ServeHTTP(w, r)
}
// GetHelmArtifactManifest operation middleware
func (siw *ServerInterfaceWrapper) GetHelmArtifactManifest(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
@ -1208,12 +1189,11 @@ func (siw *ServerInterfaceWrapper) GetHelmArtifactManifest(w http.ResponseWriter
handler = middleware(handler)
}
handler.ServeHTTP(w, r.WithContext(ctx))
handler.ServeHTTP(w, r)
}
// GetArtifactVersionSummary operation middleware
func (siw *ServerInterfaceWrapper) GetArtifactVersionSummary(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
@ -1252,12 +1232,11 @@ func (siw *ServerInterfaceWrapper) GetArtifactVersionSummary(w http.ResponseWrit
handler = middleware(handler)
}
handler.ServeHTTP(w, r.WithContext(ctx))
handler.ServeHTTP(w, r)
}
// GetAllArtifactVersions operation middleware
func (siw *ServerInterfaceWrapper) GetAllArtifactVersions(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
@ -1330,12 +1309,11 @@ func (siw *ServerInterfaceWrapper) GetAllArtifactVersions(w http.ResponseWriter,
handler = middleware(handler)
}
handler.ServeHTTP(w, r.WithContext(ctx))
handler.ServeHTTP(w, r)
}
// GetAllArtifactsByRegistry operation middleware
func (siw *ServerInterfaceWrapper) GetAllArtifactsByRegistry(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
@ -1407,12 +1385,11 @@ func (siw *ServerInterfaceWrapper) GetAllArtifactsByRegistry(w http.ResponseWrit
handler = middleware(handler)
}
handler.ServeHTTP(w, r.WithContext(ctx))
handler.ServeHTTP(w, r)
}
// GetClientSetupDetails operation middleware
func (siw *ServerInterfaceWrapper) GetClientSetupDetails(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
@ -1452,12 +1429,11 @@ func (siw *ServerInterfaceWrapper) GetClientSetupDetails(w http.ResponseWriter,
handler = middleware(handler)
}
handler.ServeHTTP(w, r.WithContext(ctx))
handler.ServeHTTP(w, r)
}
// ListWebhooks operation middleware
func (siw *ServerInterfaceWrapper) ListWebhooks(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
@ -1521,12 +1497,11 @@ func (siw *ServerInterfaceWrapper) ListWebhooks(w http.ResponseWriter, r *http.R
handler = middleware(handler)
}
handler.ServeHTTP(w, r.WithContext(ctx))
handler.ServeHTTP(w, r)
}
// CreateWebhook operation middleware
func (siw *ServerInterfaceWrapper) CreateWebhook(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
@ -1547,12 +1522,11 @@ func (siw *ServerInterfaceWrapper) CreateWebhook(w http.ResponseWriter, r *http.
handler = middleware(handler)
}
handler.ServeHTTP(w, r.WithContext(ctx))
handler.ServeHTTP(w, r)
}
// DeleteWebhook operation middleware
func (siw *ServerInterfaceWrapper) DeleteWebhook(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
@ -1582,12 +1556,11 @@ func (siw *ServerInterfaceWrapper) DeleteWebhook(w http.ResponseWriter, r *http.
handler = middleware(handler)
}
handler.ServeHTTP(w, r.WithContext(ctx))
handler.ServeHTTP(w, r)
}
// GetWebhook operation middleware
func (siw *ServerInterfaceWrapper) GetWebhook(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
@ -1617,12 +1590,11 @@ func (siw *ServerInterfaceWrapper) GetWebhook(w http.ResponseWriter, r *http.Req
handler = middleware(handler)
}
handler.ServeHTTP(w, r.WithContext(ctx))
handler.ServeHTTP(w, r)
}
// UpdateWebhook operation middleware
func (siw *ServerInterfaceWrapper) UpdateWebhook(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
@ -1652,12 +1624,11 @@ func (siw *ServerInterfaceWrapper) UpdateWebhook(w http.ResponseWriter, r *http.
handler = middleware(handler)
}
handler.ServeHTTP(w, r.WithContext(ctx))
handler.ServeHTTP(w, r)
}
// ListWebhookExecutions operation middleware
func (siw *ServerInterfaceWrapper) ListWebhookExecutions(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
@ -1706,12 +1677,11 @@ func (siw *ServerInterfaceWrapper) ListWebhookExecutions(w http.ResponseWriter,
handler = middleware(handler)
}
handler.ServeHTTP(w, r.WithContext(ctx))
handler.ServeHTTP(w, r)
}
// GetWebhookExecution operation middleware
func (siw *ServerInterfaceWrapper) GetWebhookExecution(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
@ -1750,12 +1720,11 @@ func (siw *ServerInterfaceWrapper) GetWebhookExecution(w http.ResponseWriter, r
handler = middleware(handler)
}
handler.ServeHTTP(w, r.WithContext(ctx))
handler.ServeHTTP(w, r)
}
// ReTriggerWebhookExecution operation middleware
func (siw *ServerInterfaceWrapper) ReTriggerWebhookExecution(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
@ -1794,12 +1763,11 @@ func (siw *ServerInterfaceWrapper) ReTriggerWebhookExecution(w http.ResponseWrit
handler = middleware(handler)
}
handler.ServeHTTP(w, r.WithContext(ctx))
handler.ServeHTTP(w, r)
}
// GetArtifactStatsForSpace operation middleware
func (siw *ServerInterfaceWrapper) GetArtifactStatsForSpace(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
@ -1839,12 +1807,11 @@ func (siw *ServerInterfaceWrapper) GetArtifactStatsForSpace(w http.ResponseWrite
handler = middleware(handler)
}
handler.ServeHTTP(w, r.WithContext(ctx))
handler.ServeHTTP(w, r)
}
// GetAllArtifacts operation middleware
func (siw *ServerInterfaceWrapper) GetAllArtifacts(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
@ -1932,12 +1899,11 @@ func (siw *ServerInterfaceWrapper) GetAllArtifacts(w http.ResponseWriter, r *htt
handler = middleware(handler)
}
handler.ServeHTTP(w, r.WithContext(ctx))
handler.ServeHTTP(w, r)
}
// GetAllRegistries operation middleware
func (siw *ServerInterfaceWrapper) GetAllRegistries(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
@ -2025,7 +1991,7 @@ func (siw *ServerInterfaceWrapper) GetAllRegistries(w http.ResponseWriter, r *ht
handler = middleware(handler)
}
handler.ServeHTTP(w, r.WithContext(ctx))
handler.ServeHTTP(w, r)
}
type UnescapedCookieParamError struct {
@ -5796,69 +5762,69 @@ var swaggerSpec = []string{
"BV3t9ghIr3s9qDo5v0g+JDtOVN7VS3FBALsSZ/L0J1zfQh9B8idc1wcPZBmtxyEot6D4L1uUvk2BDyeB",
"UlQ5gNGVnQKy1DaMJf0tBOTlGrsulzJ0Wp03DQX3G88dxkm8XiUMD8p1oDhAMbg8+8QRBTw3COn3VRgD",
"wvflK5CmlIKLX+7ll9Gf41mXi5JREs/Dheu5H8efx7PJyFT3I4whCn1D5U/j6xv7Y6K82s3w2/izqd4N",
"eIKxoeL0+3RiqjddT0NttY0nkbz+XPKoZT63G89NYvhl7l781f26Ke+h64mZZcUm7rfVNfOxraaZk/de",
"RSlwNRMMiVbKxNcPepURJM9xlIAgP3m2OORdJQEz8Awdcp8xzQd1xlv08bQMDiyOlGtNPhWO5c0aIVyB",
"BWTI80qegNzymnJvtwxRGVfJrKt8z+i5Vp4UcUTUzUNcpVg00ETBDSRALocGzZUXqYJGTjzuMvPdB0Xr",
"YHIjEHMovKRZFI2S1QrE+i5RLRaosZhxpbOGX8yRp+m3GiJR6bVp+rkzUm3ua1dhvJwJAF3mX9aRVzwW",
"Vdi91S1JkHIzZFEtSzv1s2lik7hAtmCUKNlNwW4lSYU+0jW5jZy1aOV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7nqX3EF6UXHdZie+xf2cSX7L7zu9vADXIWcv9J0q/f7ijqCfIRw+7Sy7fRLjjrJb",
"Epq68LKnOWgDXIyqW5bca4Q/UjEAaTh4+oPNn2ir9nL4dMKf2WR3TJ6TsVM2z4koMUglRryToRBIgaRv",
"bQGJaAIouki0UKinxgbk8/9OMnd45KWusVp0m3WbSxitdC1WXK/N7WlZ9lzc54r2cht/c7/5/wAAAP//",
"knNw4uTjAAA=",
}
// GetSwagger returns the content of the embedded swagger specification file

View File

@ -1,6 +1,6 @@
// Package artifact provides primitives to interact with the openapi HTTP API.
//
// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.0 DO NOT EDIT.
// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.
package artifact
import (
@ -30,7 +30,7 @@ const (
PackageTypeGENERIC PackageType = "GENERIC"
PackageTypeHELM PackageType = "HELM"
PackageTypeMAVEN PackageType = "MAVEN"
PackageTypePYPI PackageType = "PYPI"
PackageTypePYTHON PackageType = "PYTHON"
)
// Defines values for RegistryType.
@ -478,8 +478,8 @@ type MavenArtifactDetailConfig struct {
// PackageType refers to package
type PackageType string
// PyPiArtifactDetailConfig Config for pypi artifact details
type PyPiArtifactDetailConfig struct {
// PythonArtifactDetailConfig Config for python artifact details
type PythonArtifactDetailConfig struct {
ArtifactId *string `json:"artifactId,omitempty"`
GroupId *string `json:"groupId,omitempty"`
}
@ -1359,25 +1359,25 @@ func (t *ArtifactDetail) MergeMavenArtifactDetailConfig(v MavenArtifactDetailCon
return err
}
// AsPyPiArtifactDetailConfig returns the union data inside the ArtifactDetail as a PyPiArtifactDetailConfig
func (t ArtifactDetail) AsPyPiArtifactDetailConfig() (PyPiArtifactDetailConfig, error) {
var body PyPiArtifactDetailConfig
// AsPythonArtifactDetailConfig returns the union data inside the ArtifactDetail as a PythonArtifactDetailConfig
func (t ArtifactDetail) AsPythonArtifactDetailConfig() (PythonArtifactDetailConfig, error) {
var body PythonArtifactDetailConfig
err := json.Unmarshal(t.union, &body)
return body, err
}
// FromPyPiArtifactDetailConfig overwrites any union data inside the ArtifactDetail as the provided PyPiArtifactDetailConfig
func (t *ArtifactDetail) FromPyPiArtifactDetailConfig(v PyPiArtifactDetailConfig) error {
t.PackageType = "PYPI"
// FromPythonArtifactDetailConfig overwrites any union data inside the ArtifactDetail as the provided PythonArtifactDetailConfig
func (t *ArtifactDetail) FromPythonArtifactDetailConfig(v PythonArtifactDetailConfig) error {
t.PackageType = "PYTHON"
b, err := json.Marshal(v)
t.union = b
return err
}
// MergePyPiArtifactDetailConfig performs a merge with any union data inside the ArtifactDetail, using the provided PyPiArtifactDetailConfig
func (t *ArtifactDetail) MergePyPiArtifactDetailConfig(v PyPiArtifactDetailConfig) error {
t.PackageType = "PYPI"
// MergePythonArtifactDetailConfig performs a merge with any union data inside the ArtifactDetail, using the provided PythonArtifactDetailConfig
func (t *ArtifactDetail) MergePythonArtifactDetailConfig(v PythonArtifactDetailConfig) error {
t.PackageType = "PYTHON"
b, err := json.Marshal(v)
if err != nil {
@ -1411,8 +1411,8 @@ func (t ArtifactDetail) ValueByDiscriminator() (interface{}, error) {
return t.AsHelmArtifactDetailConfig()
case "MAVEN":
return t.AsMavenArtifactDetailConfig()
case "PYPI":
return t.AsPyPiArtifactDetailConfig()
case "PYTHON":
return t.AsPythonArtifactDetailConfig()
default:
return nil, errors.New("unknown discriminator value: " + discriminator)
}

View File

@ -69,7 +69,7 @@ func NewRouter(
r.Put("/*", genericHandler.PushArtifact)
})
r.Route("/pypi", func(r chi.Router) {
r.Route("/python", func(r chi.Router) {
r.Use(middlewareauthn.Attempt(packageHandler.GetAuthenticator()))
r.With(middleware.RequestPackageAccess(packageHandler, enum.PermissionArtifactsUpload)).
Post("/*", pypiHandler.UploadPackageFile)

View File

@ -53,7 +53,7 @@ func (c *controller) GetPackageMetadata(ctx context.Context, info ArtifactInfo,
fileInfo := File{
Name: file.Filename,
FileURL: c.urlProvider.RegistryURL(ctx) + fmt.Sprintf(
"/pkg/%s/%s/pypi/files/%s/%s/%s",
"/pkg/%s/%s/python/files/%s/%s/%s",
info.RootIdentifier,
info.RegIdentifier,
packageName,

View File

@ -426,6 +426,7 @@ func mapToWebhookDB(webhook *gitnesstypes.WebhookCore) (*webhookDB, error) {
dBWebhook.RegistryID = null.IntFrom(webhook.ParentID)
case gitnessenum.WebhookParentSpace:
dBWebhook.SpaceID = null.IntFrom(webhook.ParentID)
case gitnessenum.WebhookParentRepo:
default:
return nil, fmt.Errorf("webhook parent type %q is not supported", webhook.ParentType)
}
@ -495,6 +496,7 @@ func selectWebhookParents(
parentSelector = append(parentSelector, squirrel.Eq{
"registry_webhook_space_id": parent.ID,
})
case gitnessenum.WebhookParentRepo:
default:
return fmt.Errorf("webhook parent type '%s' is not supported", parent.Type)
}

View File

@ -224,18 +224,18 @@ func (s *Service) triggerForEventWithArtifact(
func (s *Service) getParentInfoRegistry(
ctx context.Context,
registryId int64,
registryID int64,
inherited bool,
) ([]types.WebhookParentInfo, error) {
var parents []types.WebhookParentInfo
parents = append(parents, types.WebhookParentInfo{
ID: registryId,
ID: registryID,
Type: enum.WebhookParentRegistry,
})
if inherited {
registry, err := s.registryRepository.Get(ctx, registryId)
registry, err := s.registryRepository.Get(ctx, registryID)
if err != nil {
return nil, fmt.Errorf("failed to get registry: %w", err)
}

View File

@ -1,3 +1,17 @@
// Copyright 2023 Harness, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package webhook
import (

View File

@ -19,19 +19,6 @@ import (
"golang.org/x/exp/slices"
)
func toInterfaceSlice[T interface{}](vals []T) []interface{} {
res := make([]interface{}, len(vals))
for i := range vals {
res[i] = vals[i]
}
return res
}
func sortEnum[T constraints.Ordered](slice []T) []T {
slices.Sort(slice)
return slice
}
func Sanitize[E constraints.Ordered](element E, all func() ([]E, E)) (E, bool) {
allValues, defValue := all()
var empty E