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

support/http: log user agent header at request start #2619

Merged
merged 2 commits into from
May 22, 2020
Merged

support/http: log user agent header at request start #2619

merged 2 commits into from
May 22, 2020

Conversation

leighmcculloch
Copy link
Member

PR Checklist

PR Structure

  • This PR has reasonably narrow scope (if not, break it down into smaller PRs).
  • This PR avoids mixing refactoring changes with feature changes (split into two PRs
    otherwise).
  • This PR's title starts with name of package that is most changed in the PR, ex.
    services/friendbot, or all or doc if the changes are broad or impact many
    packages.

Thoroughness

  • This PR adds tests for the most critical parts of the new functionality or fixes.
  • I've updated any docs (developer docs, .md
    files, etc... affected by this change). Take a look in the docs folder for a given service,
    like this one.

Release planning

  • I've updated the relevant CHANGELOG (here for Horizon) if
    needed with deprecations, added features, breaking changes, and DB schema changes.
  • I've decided if this PR requires a new major/minor version according to
    semver, or if it's mainly a patch change. The PR is targeted at the next
    release branch if it's not a patch change.

What

Log the User-Agent header at request start.

Why

Identifying which agent sent a request can be useful in the reference
implementations that accept inbound requests. It can be useful for
debugging strange issues, understanding broad usage patterns, and if a
service is deployed in use with a specific client and that client uses
the User-Agent header to communicate its version it can help an operator
understand what versions of its client are accessing the service. This
can help make decisions about upgrade plans, etc.

The specific use case I have is that we are deploying webauth and
recoverysigner with a client and I want to be able to know which version
of the client is accessing these services.

Horizon and the Horizon SDKs actually use some custom headers to achieve
this specific goal but I am not repeating that pattern since it is more
common to communicate this information in the user agent header.

The header does not normally contain any personally identifiable
information or sensitive information and so I believe there are no
concerns on that front.

This change impacts these services inside this repo:

  • exp/services/webauth
  • exp/services/recoverysigner
  • services/friendbot
  • services/federation

Known limitations

N/A

### What
Log the `User-Agent` header at request start.

### Why
Identifying which agent sent a request can be useful in the reference
implementations that accept inbound requests. It can be useful for
debugging strange issues, understanding broad usage patterns, and if a
service is deployed in use with a specific client and that client uses
the User-Agent header to communicate its version it can help an operator
understand what versions of its client are accessing the service. This
can help make decisions about upgrade plans, etc.

The specific use case I have is that we are deploying webauth and
recoverysigner with a client and I want to be able to know which version
of the client is accessing these services.

Horizon and the Horizon SDKs actually use some custom headers to achieve
this specific goal but I am not repeating that pattern since it is more
common to communicate this information in the user agent header.

The header does not normally contain any personally identifiable
information or sensitive information and so I believe there are no
concerns on that front.
@leighmcculloch leighmcculloch requested review from fnando and a team May 22, 2020 21:55
@leighmcculloch leighmcculloch self-assigned this May 22, 2020
@cla-bot cla-bot bot added the cla: yes label May 22, 2020
Copy link
Member

@fnando fnando left a comment

Choose a reason for hiding this comment

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

looks good. 👍

Copy link
Contributor

@debnil debnil left a comment

Choose a reason for hiding this comment

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

LGTM!

@leighmcculloch leighmcculloch merged commit 271ae0b into stellar:master May 22, 2020
@leighmcculloch leighmcculloch deleted the useragent branch May 22, 2020 22:28
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.

3 participants