Skip to content

Commit 3738d53

Browse files
authored
Initial import from github.com/joeyb/java-control-plane (envoyproxy#2)
* Initial import from github.com/joeyb/java-control-plane Signed-off-by: Joey Bratton <[email protected]> * Removed superfluous .build()s Signed-off-by: Joey Bratton <[email protected]>
1 parent a774565 commit 3738d53

File tree

89 files changed

+9657
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+9657
-0
lines changed

.circleci/config.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
version: 2
2+
jobs:
3+
build:
4+
docker:
5+
- image: circleci/openjdk:8-jdk
6+
7+
working_directory: ~/repo
8+
9+
environment:
10+
# Customize the JVM maximum heap limit
11+
MAVEN_OPTS: -Xms512m -Xmx1024m
12+
13+
steps:
14+
- checkout
15+
16+
# Download and cache dependencies
17+
- restore_cache:
18+
keys:
19+
- v1-dependencies-{{ checksum "pom.xml" }}-{{ checksum "cache/pom.xml" }}-{{ checksum "server/pom.xml" }}
20+
# fallback to using the latest cache if no exact match is found
21+
- v1-dependencies-
22+
23+
- run: mvn -B install -DskipTests dependency:go-offline
24+
25+
- save_cache:
26+
paths:
27+
- ~/.m2
28+
key: v1-dependencies-{{ checksum "pom.xml" }}-{{ checksum "cache/pom.xml" }}-{{ checksum "server/pom.xml" }}
29+
30+
# run tests!
31+
- run: mvn -B verify
32+
33+
- run: bash <(curl -s https://codecov.io/bash)

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
charset = utf-8
6+
trim_trailing_whitespace = true
7+
insert_final_newline = true
8+
9+
[*.java]
10+
indent_style = space
11+
indent_size = 2
12+
continuation_indent_size = 4

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
### IntelliJ
2+
3+
.idea/
4+
*.iml
5+
*.ipr
6+
7+
### Eclipse
8+
9+
.classpath
10+
.project
11+
.settings
12+
13+
### Maven
14+
15+
target/
16+
pom.xml.tag
17+
pom.xml.releaseBackup
18+
pom.xml.versionsBackup
19+
pom.xml.next
20+
release.properties
21+
dependency-reduced-pom.xml
22+
buildNumber.properties
23+
.mvn/timing.properties
24+
.testcontainers*

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# java-control-plane
2+
3+
[![CircleCI](https://circleci.com/gh/envoyproxy/java-control-plane.svg?style=svg)](https://circleci.com/gh/envoyproxy/java-control-plane) [![codecov](https://codecov.io/gh/envoyproxy/java-control-plane/branch/master/graph/badge.svg)](https://codecov.io/gh/envoyproxy/java-control-plane)
4+
5+
This repository contains a Java-based implementation of an API server that implements the discovery service APIs defined
6+
in [data-plane-api](https://github.com/envoyproxy/data-plane-api). It is a port of the
7+
[go-control-plane](https://github.com/envoyproxy/go-control-plane).
8+
9+
### Requirements
10+
11+
1. Java 8+
12+
2. Maven
13+
14+
### Build & Test
15+
16+
```bash
17+
mvn clean package
18+
```
19+
20+
More thorough usage examples are still TODO, but there is a basic test implementation in
21+
[TestMain](server/src/test/java/io/envoyproxy/controlplane/server/TestMain.java).

api/pom.xml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<parent>
6+
<artifactId>java-control-plane</artifactId>
7+
<groupId>io.envoyproxy.controlplane</groupId>
8+
<version>0.0.1-SNAPSHOT</version>
9+
</parent>
10+
11+
<artifactId>api</artifactId>
12+
13+
<dependencies>
14+
<dependency>
15+
<groupId>io.grpc</groupId>
16+
<artifactId>grpc-protobuf</artifactId>
17+
<version>${grpc.version}</version>
18+
</dependency>
19+
20+
<dependency>
21+
<groupId>io.grpc</groupId>
22+
<artifactId>grpc-stub</artifactId>
23+
<version>${grpc.version}</version>
24+
</dependency>
25+
</dependencies>
26+
27+
<build>
28+
<extensions>
29+
<extension>
30+
<groupId>kr.motd.maven</groupId>
31+
<artifactId>os-maven-plugin</artifactId>
32+
<version>1.5.0.Final</version>
33+
</extension>
34+
</extensions>
35+
<plugins>
36+
<plugin>
37+
<groupId>org.xolstice.maven.plugins</groupId>
38+
<artifactId>protobuf-maven-plugin</artifactId>
39+
<version>0.5.0</version>
40+
<configuration>
41+
<protocArtifact>com.google.protobuf:protoc:3.5.1-1:exe:${os.detected.classifier}</protocArtifact>
42+
<pluginId>grpc-java</pluginId>
43+
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.9.0:exe:${os.detected.classifier}</pluginArtifact>
44+
</configuration>
45+
<executions>
46+
<execution>
47+
<goals>
48+
<goal>compile</goal>
49+
<goal>compile-custom</goal>
50+
</goals>
51+
</execution>
52+
</executions>
53+
</plugin>
54+
</plugins>
55+
</build>
56+
</project>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
syntax = "proto3";
2+
3+
// [#proto-status: draft]
4+
5+
package envoy.api.v2.auth;
6+
option go_package = "auth";
7+
8+
import "envoy/api/v2/auth/cert.proto";
9+
10+
import "gogoproto/gogo.proto";
11+
12+
option (gogoproto.equal_all) = true;
13+
14+
message AuthAction {
15+
// Should we do white-list or black-list style access control.
16+
enum ActionType {
17+
// Request matches all rules are allowed, otherwise denied.
18+
ALLOW = 0;
19+
// Request matches all rules or missing required auth fields are denied,
20+
// otherwise allowed.
21+
DENY = 1;
22+
}
23+
24+
ActionType action_type = 1;
25+
26+
// Logic AND that requires all rules match.
27+
message AndRule {
28+
repeated Rule rules = 1;
29+
}
30+
31+
// Logic OR that requires at least one rule matches.
32+
message OrRule {
33+
repeated Rule rules = 1;
34+
}
35+
36+
// Check peer identity using X.509 certificate.
37+
message X509Rule {
38+
// How to validate peer certificates.
39+
CertificateValidationContext validation_context = 3;
40+
}
41+
42+
// Element type of AndRule/OrRule, it chooses among different type of rule.
43+
message Rule {
44+
oneof rule_specifier {
45+
AndRule and_rule = 1;
46+
OrRule or_rule = 2;
47+
X509Rule x509_rule = 3;
48+
}
49+
}
50+
51+
// List of rules
52+
repeated Rule rules = 2;
53+
}

0 commit comments

Comments
 (0)