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

Use project ID from header #32

Merged
merged 4 commits into from
Mar 13, 2024
Merged

Conversation

patrislav
Copy link
Member

The ingress proxy already uses quotacontrol and passes the project ID in the X-Sequence-Project header.

Because of the change in how v2 access keys are generated, we'd need to bring quotacontrol as dependency just for extracting the project ID from the key. And instead, we can do that by utilizing the header we already receive.

Closes https://github.com/0xsequence/issue-tracker/issues/1983

@@ -68,7 +69,7 @@ func TestRPC_SendIntent_SendTransaction(t *testing.T) {

c := proto.NewWaasAuthenticatorClient(srv.URL, http.DefaultClient)
header := make(http.Header)
header.Set("X-Access-Key", newRandAccessKey(tenant.ProjectID))
header.Set("X-Sequence-Project", strconv.Itoa(int(tenant.ProjectID)))
Copy link
Member

Choose a reason for hiding this comment

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

hmm, what is X-Sequence-Project....? I dont remember, is that a thing..?

Copy link
Member Author

Choose a reason for hiding this comment

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

the ingress proxy parses the access key (as it uses quotacontrol) and passes it to waas-authenticator in the X-Sequence-Project header - this is already in place

@pkieltyka pkieltyka merged commit 43f5f35 into master Mar 13, 2024
2 checks passed
@pkieltyka pkieltyka deleted the use-x-sequence-project-header branch March 13, 2024 19:07
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