Skip to content

Commit

Permalink
fix: revert select changes due to an overeager refactor in the schema…
Browse files Browse the repository at this point in the history
…gen code
  • Loading branch information
zinic committed Jan 22, 2024
1 parent ee430e3 commit 294f769
Show file tree
Hide file tree
Showing 10 changed files with 163 additions and 85 deletions.
16 changes: 16 additions & 0 deletions cmd/api/src/api/v2/apiclient/flags.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// Copyright 2023 Specter Ops, Inc.
//
// Licensed under the Apache License, Version 2.0
// 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.
//
// SPDX-License-Identifier: Apache-2.0

package apiclient

import (
Expand Down
16 changes: 16 additions & 0 deletions packages/go/cypher/backend/pgsql/pgtransition/shortestpaths.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// Copyright 2023 Specter Ops, Inc.
//
// Licensed under the Apache License, Version 2.0
// 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.
//
// SPDX-License-Identifier: Apache-2.0

package pgtransition

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// Copyright 2023 Specter Ops, Inc.
//
// Licensed under the Apache License, Version 2.0
// 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.
//
// SPDX-License-Identifier: Apache-2.0

package pgtransition_test

import (
Expand Down
16 changes: 16 additions & 0 deletions packages/go/cypher/model/functions.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// Copyright 2023 Specter Ops, Inc.
//
// Licensed under the Apache License, Version 2.0
// 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.
//
// SPDX-License-Identifier: Apache-2.0

package model

const (
Expand Down
16 changes: 16 additions & 0 deletions packages/go/cypher/model/pg/extension.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// Copyright 2023 Specter Ops, Inc.
//
// Licensed under the Apache License, Version 2.0
// 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.
//
// SPDX-License-Identifier: Apache-2.0

package pg

import "github.com/specterops/bloodhound/cypher/model"
Expand Down
16 changes: 16 additions & 0 deletions packages/go/cypher/model/pg/model.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// Copyright 2023 Specter Ops, Inc.
//
// Licensed under the Apache License, Version 2.0
// 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.
//
// SPDX-License-Identifier: Apache-2.0

package pg

import (
Expand Down
18 changes: 0 additions & 18 deletions packages/go/dawgs/graph/mocks/query.go

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

78 changes: 39 additions & 39 deletions packages/go/graphschema/azure/azure.go

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

48 changes: 24 additions & 24 deletions packages/go/graphschema/common/common.go

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

8 changes: 4 additions & 4 deletions packages/go/schemagen/generator/golang.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func WriteGolangStringEnumeration(root *jen.File, enumTypeSymbol string, values
})

var allString string
if enumTypeSymbol == "Item" {
if enumTypeSymbol == "Property" {
allString = "AllProperties"
} else {
allString = "All" + enumTypeSymbol + "s"
Expand Down Expand Up @@ -161,7 +161,7 @@ func GenerateGolangAzure(pkgName, dir string, azureSchema model.Azure) error {
root.HeaderComment(fmt.Sprintf("// Code generated by Cuelang code gen. DO NOT EDIT!\n// Cuelang source: %s/", SchemaSourceName))

WriteGolangKindDefinitions(root, kinds)
WriteGolangStringEnumeration(root, "Item", azureSchema.Properties)
WriteGolangStringEnumeration(root, "Property", azureSchema.Properties)

root.Func().Id("Relationships").Params().Index().Qual(GraphPackageName, "Kind").Block(
jen.Return(
Expand Down Expand Up @@ -279,7 +279,7 @@ func GenerateGolangGraphModel(pkgName, dir string, graphSchema model.Graph) erro
WriteGolangKindDefinitions(root, kinds)

if len(graphSchema.Properties) > 0 {
WriteGolangStringEnumeration(root, "Item", graphSchema.Properties)
WriteGolangStringEnumeration(root, "Property", graphSchema.Properties)
}

root.Func().Id("Nodes").Params().Index().Qual(GraphPackageName, "Kind").Block(
Expand Down Expand Up @@ -324,7 +324,7 @@ func GenerateGolangActiveDirectory(pkgName, dir string, adSchema model.ActiveDir
root.HeaderComment(fmt.Sprintf("// Code generated by Cuelang code gen. DO NOT EDIT!\n// Cuelang source: %s/", SchemaSourceName))

WriteGolangKindDefinitions(root, kinds)
WriteGolangStringEnumeration(root, "Item", adSchema.Properties)
WriteGolangStringEnumeration(root, "Property", adSchema.Properties)

root.Func().Id("Nodes").Params().Index().Qual(GraphPackageName, "Kind").Block(
jen.Return(
Expand Down

0 comments on commit 294f769

Please sign in to comment.