Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/go_modules/chaoscenter/graphql/…
Browse files Browse the repository at this point in the history
…server/golang.org/x/crypto-0.27.0
  • Loading branch information
imrajdas authored Sep 9, 2024
2 parents ef19bbb + 1165445 commit db16e3f
Show file tree
Hide file tree
Showing 42 changed files with 3,159 additions and 467 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ func InviteUsers(service services.ApplicationService) gin.HandlerFunc {
// @Failure 400 {object} response.ErrInvalidRequest
// @Failure 400 {object} response.ErrUserNotFound
// @Failure 400 {object} response.ErrUserDeactivated
// @Failure 400 {object} response.ErrInvalidCredentials
// @Failure 401 {object} response.ErrInvalidCredentials
// @Failure 500 {object} response.ErrServerError
// @Success 200 {object} response.LoginResponse{}
// @Router /login [post]
Expand Down
4 changes: 2 additions & 2 deletions chaoscenter/authentication/pkg/utils/sanitizers.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func SanitizeString(input string) string {
/*
ValidateStrictPassword represents and checks for the following patterns:
- Input is at least 8 characters long and at most 16 characters long
- Input contains at least one special character of these @$!%*?_&
- Input contains at least one special character of these @$!%*?_&#
- Input contains at least one digit
- Input contains at least one uppercase alphabet
- Input contains at least one lowercase alphabet
Expand All @@ -33,7 +33,7 @@ func ValidateStrictPassword(input string) error {
digits := `[0-9]{1}`
lowerAlphabets := `[a-z]{1}`
capitalAlphabets := `[A-Z]{1}`
specialCharacters := `[@$!%*?_&]{1}`
specialCharacters := `[@$!%*?_&#]{1}`
if b, err := regexp.MatchString(digits, input); !b || err != nil {
return fmt.Errorf("password does not contain digits")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,11 +358,11 @@ type KubeObjectResponse {
"""
Type of the Kubernetes object
"""
kubeObj: [KubeObject]!
kubeObj: KubeObject!
}

"""
KubeObject consists of the namespace and the available resources in the same
KubeObject consists of the available resources in a namespace
"""
type KubeObject {
"""
Expand Down Expand Up @@ -404,16 +404,75 @@ input KubeObjectRequest {
GVR Request
"""
kubeObjRequest: KubeGVRRequest
"""
Namespace in which the Kubernetes object is present
"""
namespace: String!
objectType: String!
workloads: [Workload]
}

"""
Defines details for fetching Kubernetes namespace data
"""
input KubeNamespaceRequest {
"""
ID of the infra
"""
infraID: ID!
}

"""
Define name in the infra (not really useful at the moment but maybe we will need other field later)
"""
type KubeNamespace{
"""
Name of the namespace
"""
name: String!
}



input KubeGVRRequest {
group: String!
version: String!
resource: String!
}

"""
Response received for querying Kubernetes Namespaces
"""
type KubeNamespaceResponse {
"""
ID of the infra in which the Kubernetes namespace is present
"""
infraID: ID!
"""
List of the Kubernetes namespace
"""
kubeNamespace: [KubeNamespace]!
}

"""
Defines the details of Kubernetes namespace
"""
input KubeNamespaceData {
"""
Unique request ID for fetching Kubernetes namespace details
"""
requestID: ID!
"""
ID of the infra in which the Kubernetes namespace is present
"""
infraID: InfraIdentity!
"""
List of KubeNamespace return by subscriber
"""
kubeNamespace: String!
}


"""
Defines the details of Kubernetes object
"""
Expand Down Expand Up @@ -638,6 +697,12 @@ extend type Mutation {
"""
# authorized directive not required
kubeObj(request: KubeObjectData!): String!

"""
Receives kubernetes namespace data from subscriber
"""
# authorized directive not required
kubeNamespace(request: KubeNamespaceData!): String!
}

extend type Subscription {
Expand All @@ -663,4 +728,9 @@ extend type Subscription {
Returns a kubernetes object given an input
"""
getKubeObject(request: KubeObjectRequest!): KubeObjectResponse!

"""
Returns a kubernetes namespaces given an input
"""
getKubeNamespace(request: KubeNamespaceRequest!): KubeNamespaceResponse!
}
24 changes: 24 additions & 0 deletions chaoscenter/graphql/definitions/shared/chaoshub.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ type ChaosHub implements ResourceDetails & Audit {
"""
repoBranch: String!
"""
Connected Hub of remote repository
"""
remoteHub: String!
"""
ID of the project in which the chaos hub is present
"""
projectID: ID!
Expand Down Expand Up @@ -206,6 +210,10 @@ type ChaosHubStatus implements ResourceDetails & Audit {
"""
repoBranch: String!
"""
Connected Hub of remote repository
"""
remoteHub: String!
"""
Bool value indicating whether the hub is available or not.
"""
isAvailable: Boolean!
Expand Down Expand Up @@ -320,6 +328,10 @@ input CreateChaosHubRequest {
"""
repoBranch: String!
"""
Connected Hub of remote repository
"""
remoteHub: String!
"""
Bool value indicating whether the hub is private or not.
"""
isPrivate: Boolean!
Expand Down Expand Up @@ -382,6 +394,10 @@ input CloningInput {
"""
repoURL: String!
"""
Connected Hub of remote repository
"""
remoteHub: String!
"""
Bool value indicating whether the hub is private or not.
"""
isPrivate: Boolean!
Expand Down Expand Up @@ -426,6 +442,10 @@ input CreateRemoteChaosHub {
URL of the git repository
"""
repoURL: String!
"""
Connected Hub of remote repository
"""
remoteHub: String!
}


Expand Down Expand Up @@ -455,6 +475,10 @@ input UpdateChaosHubRequest {
"""
repoBranch: String!
"""
Connected Hub of remote repository
"""
remoteHub: String!
"""
Bool value indicating whether the hub is private or not.
"""
isPrivate: Boolean!
Expand Down
2 changes: 1 addition & 1 deletion chaoscenter/graphql/server/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.9.0
github.com/tidwall/gjson v1.17.1
github.com/tidwall/gjson v1.17.3
github.com/tidwall/sjson v1.2.5
github.com/vektah/gqlparser/v2 v2.5.16
go.mongodb.org/mongo-driver v1.16.1
Expand Down
4 changes: 2 additions & 2 deletions chaoscenter/graphql/server/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1120,8 +1120,8 @@ github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG
github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA=
github.com/thecodeteam/goscaleio v0.1.0/go.mod h1:68sdkZAsK8bvEwBlbQnlLS+xU+hvLYM/iQ8KXej1AwM=
github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/gjson v1.17.1 h1:wlYEnwqAHgzmhNUFfw7Xalt2JzQvsMx2Se4PcoFCT/U=
github.com/tidwall/gjson v1.17.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/gjson v1.17.3 h1:bwWLZU7icoKRG+C+0PNwIKC6FCJO/Q3p2pZvuP0jN94=
github.com/tidwall/gjson v1.17.3/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
github.com/tidwall/pretty v0.0.0-20180105212114-65a9db5fad51/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
Expand Down
23 changes: 23 additions & 0 deletions chaoscenter/graphql/server/graph/chaos_infrastructure.resolvers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit db16e3f

Please sign in to comment.