Skip to content

Add audiences in userInfo#744

Merged
qiwzhang merged 9 commits intocloudendpoints:masterfrom
TAOXUY:addAudience
Jan 6, 2020
Merged

Add audiences in userInfo#744
qiwzhang merged 9 commits intocloudendpoints:masterfrom
TAOXUY:addAudience

Conversation

@TAOXUY
Copy link
Copy Markdown
Contributor

@TAOXUY TAOXUY commented Jan 3, 2020

  • add "audiences" to userInfo(audiences won't be in claim when it is a list due to grpc library bug)
  • fix grpc_json brother empty bug: right now, all grpc_json object is non-empty as it is inited in stack, so all childs will be always added to next of prev child but some of them should not because they are empty.

Comment thread src/api_manager/auth/lib/json_util.cc Outdated
}

grpc_json *CreateGrpcJsonArrayByStringSet(const std::set<std::string> &strSet,
grpc_json array_elem[],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

use raw pointer for array_elem

Comment thread src/api_manager/auth/lib/json_util.cc Outdated
for (const std::string &elem : strSet) {
grpc_json *cur = &array_elem[idx++];
memset(cur, 0, sizeof(grpc_json));
FillChild(cur, prev, child, nullptr, elem.c_str(), GRPC_JSON_STRING);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

prev = FillChild(...

VerifyWriteUserInfo(expected_json, user_info);
}

TEST(EspJsonTest, MultipleAudiencesTest) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please add empty audiences test

@TAOXUY TAOXUY changed the title Add audience Add audiences in userInfo Jan 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants