Skip to content

Commit

Permalink
Add base_config and partial_config files under restricted_destination…
Browse files Browse the repository at this point in the history
… testdata (#1106)

* Expose public methods to convert function and variable decl to v1 Decl

* Break up restricted destinations test config file into base_config and partial_config files to be used for test runner
  • Loading branch information
aakash070 authored Jan 15, 2025
1 parent 43bc483 commit ee426f4
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
45 changes: 45 additions & 0 deletions policy/testdata/restricted_destinations/base_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Copyright 2024 Google LLC
#
# 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
#
# https://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.

name: "labels"
extensions:
- name: "lists"
- name: "sets"
variables:
- name: "destination.ip"
type:
type_name: "string"
- name: "origin.ip"
type:
type_name: "string"
- name: "spec.restricted_destinations"
type:
type_name: "list"
params:
- type_name: "string"
- name: "spec.origin"
type:
type_name: "string"
- name: "request"
type:
type_name: "map"
params:
- type_name: "string"
- type_name: "dyn"
- name: "resource"
type:
type_name: "map"
params:
- type_name: "string"
- type_name: "dyn"
23 changes: 23 additions & 0 deletions policy/testdata/restricted_destinations/partial_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2024 Google LLC
#
# 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
#
# https://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.

name: "labels"
functions:
- name: "locationCode"
overloads:
- id: "locationCode_string"
args:
- type_name: "string"
return:
type_name: "string"

0 comments on commit ee426f4

Please sign in to comment.