Skip to content

Commit

Permalink
Merge pull request from GHSA-2gvw-w6fj-7m3c
Browse files Browse the repository at this point in the history
* chore: Update USERS.md (argoproj#17683)

Add Shield.com as one of the users in the USER.md file

Signed-off-by: suhas-chikkanna <162577490+suhas-chikkanna@users.noreply.github.com>

sec: validate project before execute action

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* sec: validate a project before execute an action

Signed-off-by: pashakostohrys <pavel@codefresh.io>

---------

Signed-off-by: pashakostohrys <pavel@codefresh.io>
Co-authored-by: suhas-chikkanna <162577490+suhas-chikkanna@users.noreply.github.com>
  • Loading branch information
2 people authored and Hariharasuthan99 committed Jun 16, 2024
1 parent 1c8f3be commit c85cb82
Show file tree
Hide file tree
Showing 4 changed files with 223 additions and 104 deletions.
18 changes: 18 additions & 0 deletions pkg/apis/application/v1alpha1/app_project_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,24 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
)

type ErrApplicationNotAllowedToUseProject struct {
application string
namespace string
project string
}

func NewErrApplicationNotAllowedToUseProject(application, namespace, project string) error {
return &ErrApplicationNotAllowedToUseProject{
application: application,
namespace: namespace,
project: project,
}
}

func (err *ErrApplicationNotAllowedToUseProject) Error() string {
return fmt.Sprintf("application '%s' in namespace '%s' is not allowed to use project %s", err.application, err.namespace, err.project)
}

// AppProjectList is list of AppProject resources
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type AppProjectList struct {
Expand Down
Loading

0 comments on commit c85cb82

Please sign in to comment.