Skip to content

refactor: update authz files to use proto3.#1851

Merged
JoshuaSBrown merged 5 commits into1847-DAPS-refactor-python-client-to-use-proto3from
1848-DAPS-refactor-authz-library
Feb 7, 2026
Merged

refactor: update authz files to use proto3.#1851
JoshuaSBrown merged 5 commits into1847-DAPS-refactor-python-client-to-use-proto3from
1848-DAPS-refactor-authz-library

Conversation

@JoshuaSBrown
Copy link
Collaborator

@JoshuaSBrown JoshuaSBrown commented Feb 5, 2026

Ticket

Description

How Has This Been Tested?

Artifacts (if appropriate):

Tasks

  • - A description of the PR has been provided, and a diagram included if it is a new feature.
  • - Formatter has been run
  • - CHANGELOG comment has been added
  • - Labels have been assigned to the pr
  • - A reviwer has been added
  • - A user has been assigned to work on the pr
  • - If new feature a unit test has been added

Summary by Sourcery

Refactor GridFTP authz worker and tests to use the consolidated proto3 envelope definitions and updated version metadata.

Enhancements:

  • Replace legacy SDMS Anon/Auth protobuf includes and namespaces with the unified proto3 envelope definitions in the SDMS namespace.
  • Update version and release metadata accessors to read from proto-defined protocol::version and release fields instead of preprocessor macros.

Tests:

  • Adjust authz unit tests to construct and validate messages using the new proto3 message types and namespaces.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Feb 5, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Refactors the GridFTP authz worker and its unit tests to use the consolidated proto3 envelope definitions and new version constants, replacing legacy SDMS Anon/Auth protobuf types and macros.

Updated class diagram for AuthzWorker proto3 migration

classDiagram
    class AuthzWorker {
        +int processResponse(response)
        +int checkAuth(client_id, path, action)
        +static const char* getVersion()
        +static const char* getAPIVersion()
        +static const char* getReleaseVersion()
        -Config* m_config
    }

    class RepoAuthzRequest {
        +void set_repo(repo)
        +void set_client(client)
        +void set_path(path)
        +void set_action(action)
    }

    class NackReply {
        +int code
        +string message
    }

    class protocol_version {
        <<static constants>>
        +int MAJOR
        +int MINOR
        +int PATCH
    }

    class release {
        <<static constants>>
        +int YEAR
        +int MONTH
        +int DAY
        +int HOUR
        +int MINUTE
    }

    AuthzWorker ..> RepoAuthzRequest : creates
    AuthzWorker ..> NackReply : casts payload
    AuthzWorker ..> protocol_version : builds API version string
    AuthzWorker ..> release : builds release version string
Loading

File-Level Changes

Change Details Files
Switch authz worker from legacy SDMS Anon/Auth protobuf message types to the unified proto3 envelope messages.
  • Replace multiple SDMS*.pb.h includes with the new envelope.pb.h include
  • Change namespace usage from SDMS::Anon and SDMS::Auth to the top-level SDMS namespace
  • Update NackReply dynamic_cast and RepoAuthzRequest construction to use the new, un-namespaced proto3 message types
repository/gridftp/globus5/authz/source/AuthzWorker.cpp
Update API and release version retrieval to use new proto3 version constants.
  • Replace DATAFED_COMMON_PROTOCOL_API_* macros with protocol::version::* constants when building the API version string
  • Replace DATAFED_RELEASE_* macros with release::* constants when building the release version string
repository/gridftp/globus5/authz/source/AuthzWorker.cpp
Align unit tests with the new proto3 envelope messages and namespaces.
  • Update test includes to use envelope.pb.h
  • Update AuthenticateByTokenRequest and NackReply construction to use the SDMS top-level namespace instead of SDMS::Anon
repository/gridftp/globus5/authz/tests/unit/test_AuthzWorker.cpp

Possibly linked issues

  • #[Refactor] - upgrade Authz module to use new proto3 envelope for serialization: PR updates Authz code and tests to use envelope.proto and new proto3 message/version definitions, matching issue

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@JoshuaSBrown JoshuaSBrown self-assigned this Feb 5, 2026
@JoshuaSBrown JoshuaSBrown added Priority: Medium Above average priority Component: GridFTP Auth Module Relates to GridFTP authorization library labels Feb 5, 2026
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Consider avoiding the global using namespace SDMS; in AuthzWorker.cpp and instead qualifying the protobuf types (e.g., SDMS::NackReply, SDMS::RepoAuthzRequest) to reduce the risk of name collisions and keep the scope of the refactor more explicit.
  • In the test file, you could similarly drop the broad using namespace and use fully-qualified SDMS:: types for protobuf messages to make it clearer which generated classes are being exercised after the migration to envelope.pb.h.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider avoiding the global `using namespace SDMS;` in `AuthzWorker.cpp` and instead qualifying the protobuf types (e.g., `SDMS::NackReply`, `SDMS::RepoAuthzRequest`) to reduce the risk of name collisions and keep the scope of the refactor more explicit.
- In the test file, you could similarly drop the broad `using namespace` and use fully-qualified `SDMS::` types for protobuf messages to make it clearer which generated classes are being exercised after the migration to `envelope.pb.h`.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@JoshuaSBrown JoshuaSBrown added the Type: Refactor Imlplementation change, same functionality label Feb 5, 2026
@JoshuaSBrown JoshuaSBrown force-pushed the 1848-DAPS-refactor-authz-library branch from f92e446 to af693c7 Compare February 6, 2026 19:20
@JoshuaSBrown JoshuaSBrown merged commit c8bb534 into 1847-DAPS-refactor-python-client-to-use-proto3 Feb 7, 2026
5 of 7 checks passed
JoshuaSBrown added a commit that referenced this pull request Feb 7, 2026
…nvelope (#1849)

* [DAPS-1848] - refactor: update authz files to use proto3. (#1851)
* [DAPS-1850] - refactor web server proto3 (#1852)
JoshuaSBrown added a commit that referenced this pull request Feb 7, 2026
* [DAPS-1847] - refactor: python package to be compatible with proto3 envelope (#1849)
* [DAPS-1848] - refactor: update authz files to use proto3. (#1851)
* [DAPS-1850] - refactor web server proto3 (#1852)
JoshuaSBrown added a commit that referenced this pull request Feb 7, 2026
* [DAPS-1845] - refactor repo server to use proto3 (#1846)
* [DAPS-1847] - refactor: python package to be compatible with proto3 envelope (#1849)
* [DAPS-1848] - refactor: update authz files to use proto3. (#1851)
* [DAPS-1850] - refactor web server proto3 (#1852)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: GridFTP Auth Module Relates to GridFTP authorization library Priority: Medium Above average priority Type: Refactor Imlplementation change, same functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor] - upgrade Authz module to use new proto3 envelope for serialization

1 participant