Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge from master to firebase #143

Merged
merged 50 commits into from
Mar 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
78b931b
Simple TCP server to show how to retrieve original dest IP:port after…
enricoschiattarella Jan 10, 2017
8b3a442
Rebase Envoy (#41)
kyessenov Jan 12, 2017
c3abd2a
Update prototype to use iptables (#42)
kyessenov Jan 12, 2017
add363a
Rebase to fixed Envoy (#43)
kyessenov Jan 13, 2017
ee3cdee
Handle HEAD request. (#34)
chowchow316 Jan 13, 2017
efc32a2
Expose bazel target (#48)
kyessenov Jan 21, 2017
92541b7
Try again (#49)
kyessenov Jan 21, 2017
cea8827
Integrate with mixer client. (#55)
qiwzhang Jan 27, 2017
6d7f0ee
Add originIp and originHost attributes. (#56)
qiwzhang Jan 27, 2017
4cd5c9f
Add uuid-dev dependency in README.md (#45)
lizan Jan 28, 2017
bcdb75d
Extract originIp and OriginHost. (#57)
qiwzhang Jan 28, 2017
2c9c1af
Update buckets for UI. (#58)
chowchow316 Jan 30, 2017
2796209
Add targetService attribute. (#59)
qiwzhang Feb 1, 2017
8218f92
Use envoy new access_log handler for sending Report. (#60)
qiwzhang Feb 1, 2017
1d2d6a8
Update to the latest envoy with #396. (#61)
qiwzhang Feb 2, 2017
53fd026
Fix tclap dependency fetching error (#62)
kyessenov Feb 2, 2017
33f54ed
Integrate mixer client directly with envoy. (#66)
qiwzhang Feb 6, 2017
eb8bfcc
Add release binary script. (#68)
qiwzhang Feb 6, 2017
89f0fbf
Push tar.gz to GCS (#69)
kyessenov Feb 6, 2017
7635536
Remove mixer_client from api_manager. (#72)
qiwzhang Feb 8, 2017
a6a33fd
Update mixer client SHA. (#74)
chowchow316 Feb 8, 2017
d29a195
Update readme. (#73)
chowchow316 Feb 8, 2017
fdac61b
Adds Jenkinsfile and updates release-binary to create a SHA. (#71)
sebastienvas Feb 9, 2017
6e372fc
Update grpc and protobuf (#70)
lizan Feb 9, 2017
28105ca
Add sourceService. (#78)
qiwzhang Feb 9, 2017
21f1cb3
Add script to build docker image. (#77)
qiwzhang Feb 9, 2017
673b902
Use official attribute names (#80)
qiwzhang Feb 10, 2017
366f5ae
Creates a KEY for mixer client dep. Updates release-binary (#79)
sebastienvas Feb 10, 2017
a39d555
Update src/envoy/mixer/README. (#82)
qiwzhang Feb 10, 2017
88cfb24
Fix src/envoy/mixer/README.md (#85)
wattli Feb 10, 2017
d5a878a
Get attributes from envoy config. (#87)
chowchow316 Feb 14, 2017
25adae9
updated SHA to point to newer envoy with RDS API feature (#94)
GregHanson Feb 14, 2017
1cdc2ac
Disable travis on stable branches (#96)
sebastienvas Feb 15, 2017
2f69cc9
Publish debug binaries (no release yet) (#98)
kyessenov Feb 15, 2017
8488133
Copies the binary instead of linking for release (#102)
sebastienvas Feb 16, 2017
0804a07
Not to use api_key if its service is not actived. (#109)
qiwzhang Feb 21, 2017
7444da1
Update envoy and add c-ares (#107)
kyessenov Feb 22, 2017
d093254
Send StatusCode Attributes to Mixer. (#110)
chowchow316 Feb 22, 2017
ef1aecf
Add send_attribute filter. (#115)
qiwzhang Feb 22, 2017
20e19d2
Fail request if api_key is not valid. (#116)
chowchow316 Feb 22, 2017
7fe10df
Rename response.http.code (#125)
qiwzhang Feb 24, 2017
fdfb73f
Send headers as string map. (#129)
qiwzhang Feb 25, 2017
3d402e6
unify bazel's docker build targets with other istio repos (#127)
ayj Feb 25, 2017
d71d5f3
update base debug docker image reference (#133)
ayj Feb 28, 2017
f5281ad
Update postsubmit to create docker images (#132)
sebastienvas Feb 28, 2017
0c7c549
Adding config release for bazel build (#135)
sebastienvas Mar 1, 2017
fc9497a
Fix mixer client crash. (#136)
qiwzhang Mar 1, 2017
83e1d58
Get mixerclient with response parsing. (#138)
qiwzhang Mar 2, 2017
a118aea
Update nghttp2 to sync with envoy (#140)
wattli Mar 2, 2017
eac5f4d
Merge branch 'master' of https://github.com/istio/proxy into firebase
sarvaniv Mar 2, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .bazelrc.jenkins
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This is from Bazel's former travis setup, to avoid blowing up the RAM usage.
startup --host_jvm_args=-Xmx8192m
startup --host_jvm_args=-Xms8192m
startup --batch

# This is so we understand failures better
build --verbose_failures

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
/bazel-*
.idea/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a merge from master. Please look at the exact file from master branch: I am not going to change any of the code merged. This will cause more conflicts later when we merge from / to master again. All these suggestion should be fixed only in master.

https://github.com/istio/proxy/blob/master/.gitignore

*.iml
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
sudo: required
dist: xenial

branches:
except:
- stable

lang: go

go:
Expand Down
65 changes: 65 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!groovy

@Library('testutils')

import org.istio.testutils.Utilities
import org.istio.testutils.GitUtilities
import org.istio.testutils.Bazel

// Utilities shared amongst modules
def gitUtils = new GitUtilities()
def utils = new Utilities()
def bazel = new Bazel()

mainFlow(utils) {
pullRequest(utils) {
node {
gitUtils.initialize()
// Proxy does build work correctly with Hazelcast.
// Must use .bazelrc.jenkins
bazel.setVars('', '')
}

if (utils.runStage('PRESUBMIT')) {
presubmit(gitUtils, bazel)
}
if (utils.runStage('POSTSUBMIT')) {
postsubmit(gitUtils, bazel, utils)
}
}
}

def presubmit(gitUtils, bazel) {
buildNode(gitUtils) {
stage('Code Check') {
sh('script/check-style')
}
bazel.updateBazelRc()
stage('Bazel Fetch') {
bazel.fetch('-k //...')
}
stage('Bazel Build') {
bazel.build('//...')
}
stage('Bazel Tests') {
bazel.test('//...')
}
stage('Push Test Binary') {
sh 'script/release-binary'
}
}
}

def postsubmit(gitUtils, bazel, utils) {
buildNode(gitUtils) {
bazel.updateBazelRc()
stage('Push Binary') {
sh 'script/release-binary'
}
stage('Docker Push') {
def images = 'proxy,proxy_debug'
def tags = "${gitUtils.GIT_SHORT_SHA},\$(date +%Y-%m-%d-%H.%M.%S),latest"
utils.publishDockerImages(images, tags, 'release')
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the trailing icon?

37 changes: 34 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,20 @@ googletest_repositories()
load(
"//contrib/endpoints:repositories.bzl",
"grpc_repositories",
"mixer_client_repositories",
"servicecontrol_client_repositories",
)

grpc_repositories()

mixer_client_repositories()

servicecontrol_client_repositories()

load(
"//src/envoy/mixer:repositories.bzl",
"mixer_client_repositories",
)

mixer_client_repositories()

# Workaround for Bazel > 0.4.0 since it needs newer protobuf.bzl from:
# https://github.com/google/protobuf/pull/2246
# Do not use this git_repository for anything else than protobuf.bzl
Expand All @@ -65,3 +69,30 @@ load(
)

envoy_repositories()

new_http_archive(
name = "docker_ubuntu",
build_file_content = """
load("@bazel_tools//tools/build_defs/docker:docker.bzl", "docker_build")
docker_build(
name = "xenial",
tars = ["xenial/ubuntu-xenial-core-cloudimg-amd64-root.tar.gz"],
visibility = ["//visibility:public"],
)
""",
sha256 = "de31e6fcb843068965de5945c11a6f86399be5e4208c7299fb7311634fb41943",
strip_prefix = "docker-brew-ubuntu-core-e406914e5f648003dfe8329b512c30c9ad0d2f9c",
type = "zip",
url = "https://codeload.github.com/tianon/docker-brew-ubuntu-core/zip/e406914e5f648003dfe8329b512c30c9ad0d2f9c",
)


DEBUG_BASE_IMAGE_SHA="3f57ae2aceef79e4000fb07ec850bbf4bce811e6f81dc8cfd970e16cdf33e622"

# See github.com/istio/manager/blob/master/docker/debug/build-and-publish-debug-image.sh
# for instructions on how to re-build and publish this base image layer.
http_file(
name = "ubuntu_xenial_debug",
url = "https://storage.googleapis.com/istio-build/manager/ubuntu_xenial_debug-" + DEBUG_BASE_IMAGE_SHA + ".tar.gz",
sha256 = DEBUG_BASE_IMAGE_SHA,
)
17 changes: 2 additions & 15 deletions contrib/endpoints/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def grpc_repositories(bind=True):

native.git_repository(
name = "grpc_git",
commit = "d28417c856366df704200f544e72d31056931bce",
commit = "bb3edafea245a9780cc4c10f0b58da21e8193f38", # v1.1.1
remote = "https://github.com/grpc/grpc.git",
)

Expand All @@ -190,7 +190,7 @@ def grpc_repositories(bind=True):

native.bind(
name = "grpc_lib",
actual = "@grpc_git//:grpc++_reflection",
actual = "@grpc_git//:grpc++_codegen_proto",
)

def googleapis_repositories(protobuf_repo="@protobuf_git//", bind=True):
Expand Down Expand Up @@ -335,16 +335,3 @@ def servicecontrol_client_repositories(bind=True):
name = "servicecontrol_client",
actual = "@servicecontrol_client_git//:service_control_client_lib",
)

def mixer_client_repositories(bind=True):
native.git_repository(
name = "mixerclient_git",
commit = "80e450a5126960e8e6337c3631cf2ef984038eab",
remote = "https://github.com/istio/mixerclient.git",
)

if bind:
native.bind(
name = "mixer_client_lib",
actual = "@mixerclient_git//:mixer_client_lib",
)
47 changes: 28 additions & 19 deletions contrib/endpoints/src/api_manager/auth/lib/auth_jwt_validator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ class JwtValidatorImpl : public JwtValidator {
RSA *rsa_;
EVP_PKEY *pkey_;
EVP_MD_CTX *md_ctx_;

grpc_exec_ctx exec_ctx_;
};

// Gets EVP_MD mapped from an alg (algorithm string).
Expand All @@ -159,12 +161,12 @@ const EVP_MD *EvpMdFromAlg(const char *alg);
size_t HashSizeFromAlg(const char *alg);

// Parses str into grpc_json object. Does not own buffer.
grpc_json *DecodeBase64AndParseJson(const char *str, size_t len,
gpr_slice *buffer);
grpc_json *DecodeBase64AndParseJson(grpc_exec_ctx *exec_ctx, const char *str,
size_t len, gpr_slice *buffer);

// Gets BIGNUM from b64 string, used for extracting pkey from jwk.
// Result owned by rsa_.
BIGNUM *BigNumFromBase64String(const char *b64);
BIGNUM *BigNumFromBase64String(grpc_exec_ctx *exec_ctx, const char *b64);

} // namespace

Expand All @@ -185,7 +187,8 @@ JwtValidatorImpl::JwtValidatorImpl(const char *jwt, size_t jwt_len)
x509_(nullptr),
rsa_(nullptr),
pkey_(nullptr),
md_ctx_(nullptr) {
md_ctx_(nullptr),
exec_ctx_(GRPC_EXEC_CTX_INIT) {
header_buffer_ = gpr_empty_slice();
signed_buffer_ = gpr_empty_slice();
sig_buffer_ = gpr_empty_slice();
Expand All @@ -204,7 +207,7 @@ JwtValidatorImpl::~JwtValidatorImpl() {
grpc_json_destroy(pkey_json_);
}
if (claims_ != nullptr) {
grpc_jwt_claims_destroy(claims_);
grpc_jwt_claims_destroy(&exec_ctx_, claims_);
}
if (!GPR_SLICE_IS_EMPTY(header_buffer_)) {
gpr_slice_unref(header_buffer_);
Expand Down Expand Up @@ -304,7 +307,8 @@ grpc_jwt_verifier_status JwtValidatorImpl::ParseImpl() {
if (dot == nullptr) {
return GRPC_JWT_VERIFIER_BAD_FORMAT;
}
header_json_ = DecodeBase64AndParseJson(cur, dot - cur, &header_buffer_);
header_json_ =
DecodeBase64AndParseJson(&exec_ctx_, cur, dot - cur, &header_buffer_);
CreateJoseHeader();
if (header_ == nullptr) {
return GRPC_JWT_VERIFIER_BAD_FORMAT;
Expand All @@ -323,7 +327,7 @@ grpc_jwt_verifier_status JwtValidatorImpl::ParseImpl() {
// case, and it is owned by claims_ for successful case.
gpr_slice claims_buffer = gpr_empty_slice();
grpc_json *claims_json =
DecodeBase64AndParseJson(cur, dot - cur, &claims_buffer);
DecodeBase64AndParseJson(&exec_ctx_, cur, dot - cur, &claims_buffer);
if (claims_json == nullptr) {
if (!GPR_SLICE_IS_EMPTY(claims_buffer)) {
gpr_slice_unref(claims_buffer);
Expand All @@ -332,10 +336,13 @@ grpc_jwt_verifier_status JwtValidatorImpl::ParseImpl() {
}
UpdateAudience(claims_json);
// Takes ownershp of claims_json and claims_buffer.
claims_ = grpc_jwt_claims_from_json(claims_json, claims_buffer);
if (claims_ == nullptr) {
claims_ = grpc_jwt_claims_from_json(&exec_ctx_, claims_json, claims_buffer);

// issuer is mandatory. grpc_jwt_claims_issuer checks if claims_ is nullptr.
if (grpc_jwt_claims_issuer(claims_) == nullptr) {
return GRPC_JWT_VERIFIER_BAD_FORMAT;
}

// Check timestamp.
// Passing in its own audience to skip audience check.
// Audience check should be done by the caller.
Expand All @@ -354,8 +361,8 @@ grpc_jwt_verifier_status JwtValidatorImpl::ParseImpl() {
return GRPC_JWT_VERIFIER_BAD_FORMAT;
}
cur = dot + 1;
sig_buffer_ =
grpc_base64_decode_with_len(cur, jwt_len - signed_jwt_len - 1, 1);
sig_buffer_ = grpc_base64_decode_with_len(&exec_ctx_, cur,
jwt_len - signed_jwt_len - 1, 1);
if (GPR_SLICE_IS_EMPTY(sig_buffer_)) {
return GRPC_JWT_VERIFIER_BAD_FORMAT;
}
Expand Down Expand Up @@ -576,9 +583,11 @@ bool JwtValidatorImpl::ExtractPubkeyFromJwk(const grpc_json *jkey) {
}

const char *rsa_n = GetStringValue(jkey, "n");
rsa_->n = rsa_n == nullptr ? nullptr : BigNumFromBase64String(rsa_n);
rsa_->n =
rsa_n == nullptr ? nullptr : BigNumFromBase64String(&exec_ctx_, rsa_n);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if it the right format, can you double check by clang-format?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a merge from master. I am not going to change anything here since these changes your are proposing should be done in master.

const char *rsa_e = GetStringValue(jkey, "e");
rsa_->e = rsa_e == nullptr ? nullptr : BigNumFromBase64String(rsa_e);
rsa_->e =
rsa_e == nullptr ? nullptr : BigNumFromBase64String(&exec_ctx_, rsa_e);

if (rsa_->e == nullptr || rsa_->n == nullptr) {
gpr_log(GPR_ERROR, "Missing RSA public key field.");
Expand Down Expand Up @@ -651,7 +660,7 @@ grpc_jwt_verifier_status JwtValidatorImpl::VerifyHsSignature(const char *pkey,
const EVP_MD *md = EvpMdFromAlg(header_->alg);
GPR_ASSERT(md != nullptr); // Checked before.

pkey_buffer_ = grpc_base64_decode_with_len(pkey, pkey_len, 1);
pkey_buffer_ = grpc_base64_decode_with_len(&exec_ctx_, pkey, pkey_len, 1);
if (GPR_SLICE_IS_EMPTY(pkey_buffer_)) {
gpr_log(GPR_ERROR, "Unable to decode base64 of secret");
return GRPC_JWT_VERIFIER_KEY_RETRIEVAL_ERROR;
Expand Down Expand Up @@ -742,11 +751,11 @@ size_t HashSizeFromAlg(const char *alg) {
}
}

grpc_json *DecodeBase64AndParseJson(const char *str, size_t len,
gpr_slice *buffer) {
grpc_json *DecodeBase64AndParseJson(grpc_exec_ctx *exec_ctx, const char *str,
size_t len, gpr_slice *buffer) {
grpc_json *json;

*buffer = grpc_base64_decode_with_len(str, len, 1);
*buffer = grpc_base64_decode_with_len(exec_ctx, str, len, 1);
if (GPR_SLICE_IS_EMPTY(*buffer)) {
gpr_log(GPR_ERROR, "Invalid base64.");
return nullptr;
Expand All @@ -760,12 +769,12 @@ grpc_json *DecodeBase64AndParseJson(const char *str, size_t len,
return json;
}

BIGNUM *BigNumFromBase64String(const char *b64) {
BIGNUM *BigNumFromBase64String(grpc_exec_ctx *exec_ctx, const char *b64) {
BIGNUM *result = nullptr;
gpr_slice bin;

if (b64 == nullptr) return nullptr;
bin = grpc_base64_decode(b64, 1);
bin = grpc_base64_decode(exec_ctx, b64, 1);
if (GPR_SLICE_IS_EMPTY(bin)) {
gpr_log(GPR_ERROR, "Invalid base64 for big num.");
return nullptr;
Expand Down
3 changes: 2 additions & 1 deletion contrib/endpoints/src/api_manager/auth/lib/auth_token.cc
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ char *GenerateJwtClaim(const char *issuer, const char *subject,
}

char *GenerateSignatueHs256(const char *data, const char *key) {
gpr_slice key_buffer = grpc_base64_decode(key, 1);
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
gpr_slice key_buffer = grpc_base64_decode(&exec_ctx, key, 1);
if (GPR_SLICE_IS_EMPTY(key_buffer)) {
gpr_log(GPR_ERROR, "Unable to decode base64 of secret");
return nullptr;
Expand Down
Loading