这是indexloc提供的服务,不要输入任何密码
Skip to content

Draft: Add ServiceIdentifier for application tracking #3306

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

bwdmr
Copy link

@bwdmr bwdmr commented Feb 24, 2025

This commit introduces a new ServiceIdentifier system that allows applications to be uniquely identified and tracked. The implementation includes:

  • ServiceIdentifier actor that stores app type, label, and version
  • Application extension to store and retrieve identifiers
  • Storage mechanism using the Vapor application storage system
  • Custom string representation for easy debugging
  • Comprehensive test suite validating functionality

The system prevents duplicate registrations of the same app type and provides async accessor methods to maintain thread safety.

@bwdmr bwdmr requested review from 0xTim and gwynne as code owners February 24, 2025 17:11
This commit introduces a new ServiceIdentifier system that allows applications
to be uniquely identified and tracked. The implementation includes:

- ServiceIdentifier actor that stores app type, label, and version
- Application extension to store and retrieve identifiers
- Storage mechanism using the Vapor application storage system
- Custom string representation for easy debugging
- Comprehensive test suite validating functionality

The system prevents duplicate registrations of the same app type and provides
async accessor methods to maintain thread safety.
@bwdmr bwdmr force-pushed the applicationidentifier branch from af0d3c7 to 615b568 Compare February 24, 2025 17:39
- Replace getID/setID methods with async description property and register method
- Add new ServiceIdentity struct to improve identifier handling
- Make ServiceIdentity Codable, ExpressibleByStringLiteral and CustomStringConvertible
- Implement parsing of ID components (id, label, version) from string representation
- Adjust indentation from 2 spaces to 4 spaces throughout the file
- Fix whitespace and line breaks for better readability
- Reorder extensions to improve logical flow
- Move ObjectIdentifier extension to the top of the file
- Add empty line after ServiceIdentifier init for consistent spacing
- Maintain consistent brace style across all declarations
- Rename `ServiceID` -> `ServiceIdentity` for application property
- Rename `ServiceIdentifier` -> `ServiceIdentifiable` for actor class
- Rename `ServiceIdentity` -> `ServiceIdentifier` for the Codable struct
- Adapt method names for consistency: `getId()` -> `description`, `setId()` -> `register()`
- Update test cases to use new naming conventions
- Improve variable naming with consistent ID capitalization
- Fix string property name `serviceidentifierString` -> `serviceidentityString`
@0xTim
Copy link
Member

0xTim commented Mar 26, 2025

I don't think this makes sense to add to Vapor. I don't see the benefit it would give for wider Vapor uses and can be added as a separate package if needed

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