Skip to content

Commit

Permalink
Merge pull request #3286 from glouvigny/glouvigny/fix/service-auth-to…
Browse files Browse the repository at this point in the history
…ken-id

fix: include token_id in AuthServiceCompleteFlow reply
  • Loading branch information
aeddi committed Apr 29, 2021
2 parents 85a448d + 390f331 commit b1e6996
Show file tree
Hide file tree
Showing 10 changed files with 426 additions and 350 deletions.
4 changes: 3 additions & 1 deletion api/protocoltypes.proto
Expand Up @@ -1123,7 +1123,9 @@ message AuthServiceCompleteFlow {
message Request{
string callback_url = 1 [(gogoproto.customname) = "CallbackURL"];
}
message Reply{}
message Reply{
string token_id = 1 [(gogoproto.customname) = "TokenID"];
}
}

message AuthServiceInitFlow {
Expand Down
4 changes: 4 additions & 0 deletions docs/apis/protocoltypes.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion docs/apis/protocoltypes.swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/gen.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion go/gen.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions go/pkg/bertyprotocol/api_services_auth.go
Expand Up @@ -205,16 +205,20 @@ func (s *service) AuthServiceCompleteFlow(ctx context.Context, request *protocol
i++
}

if _, err := s.accountGroup.metadataStore.SendAccountServiceTokenAdded(ctx, &protocoltypes.ServiceToken{
svcToken := &protocoltypes.ServiceToken{
Token: resMsg.AccessToken,
AuthenticationURL: auth.baseURL,
SupportedServices: services,
Expiration: -1,
}); err != nil {
}

if _, err := s.accountGroup.metadataStore.SendAccountServiceTokenAdded(ctx, svcToken); err != nil {
return nil, err
}

return &protocoltypes.AuthServiceCompleteFlow_Reply{}, nil
return &protocoltypes.AuthServiceCompleteFlow_Reply{
TokenID: svcToken.TokenID(),
}, nil
}

func (s *service) AuthServiceInitFlow(ctx context.Context, request *protocoltypes.AuthServiceInitFlow_Request) (*protocoltypes.AuthServiceInitFlow_Reply, error) {
Expand Down
731 changes: 391 additions & 340 deletions go/pkg/protocoltypes/protocoltypes.pb.go

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/gen.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions js/packages/api/root.pb.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion js/packages/api/root.pb.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b1e6996

Please sign in to comment.