-
Notifications
You must be signed in to change notification settings - Fork 3
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
Remove inbox validation for uploading key packages #400
Remove inbox validation for uploading key packages #400
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
2404937
to
49ddb76
Compare
@@ -2,5 +2,5 @@ | |||
set -e | |||
|
|||
function docker_compose() { | |||
docker-compose -f dev/docker/docker-compose.yml -p xmtpd "$@" | |||
docker compose -f dev/docker/docker-compose.yml -p xmtpd "$@" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently our Github runners have been upgraded to a new version where docker-compose
no longer exists as a separate command. You must use docker compose
instead.
49ddb76
to
a816114
Compare
@@ -130,17 +130,17 @@ func (s *Service) Publish(ctx context.Context, req *proto.PublishRequest) (*prot | |||
log.Debug("received message") | |||
|
|||
if len(env.ContentTopic) > MaxContentTopicNameSize { | |||
return nil, status.Errorf(codes.InvalidArgument, "topic length too big") | |||
return nil, status.Error(codes.InvalidArgument, "topic length too big") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our linter has apparently become more fussy with some version upgrade and this old code was causing lint fails
81914f6
to
8fdef23
Compare
@@ -96,17 +96,17 @@ func (wa *WalletAuthorizer) requiresAuthorization(req interface{}) bool { | |||
func (wa *WalletAuthorizer) getWallet(ctx context.Context) (types.WalletAddr, error) { | |||
md, ok := metadata.FromIncomingContext(ctx) | |||
if !ok { | |||
return "", status.Errorf(codes.Unauthenticated, "metadata is not provided") | |||
return "", status.Error(codes.Unauthenticated, "metadata is not provided") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stricter linting updates again
8fdef23
to
ec2480f
Compare
* | ||
DEPRECATED: Use UploadKeyPackage instead | ||
* | ||
*/ | ||
func (s *Service) RegisterInstallation(ctx context.Context, req *mlsv1.RegisterInstallationRequest) (*mlsv1.RegisterInstallationResponse, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't really need a separate endpoint for registering an installation and updating the key package. Can just do a "create or update" query and have one endpoint for everything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it, this is so much cleaner
InstallationId []byte | ||
Expiration uint64 | ||
} | ||
|
||
func (s *MLSValidationServiceImpl) ValidateInboxIdKeyPackages(ctx context.Context, keyPackages [][]byte) ([]InboxIdValidationResult, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this just be ValidateKeyPackages
now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some items further down in the tracking issue for cleaning up dead code and renaming things. Didn't want to do too much at once
tl;dr
PublishIdentityUpdate
is calledAI Assisted Summary
This pull request includes several changes to the project, primarily focused on refactoring the installation registration process and updating the database schema. The key changes made are:
inbox_id
andexpiration
columns from theinstallations
table.UpdateKeyPackage
query and the addition ofCreateOrUpdateInstallation
query with upsert logic.RegisterInstallation
method in favor ofUploadKeyPackage
.ValidateInboxIdKeyPackages
method by removing intermediate validation requests and leveraging direct validation responses.These changes aim to streamline the installation registration process, reduce database schema complexity, and improve overall code maintainability.