Skip to content

Conversation

@battermann
Copy link
Contributor

@battermann battermann commented Jan 11, 2022

https://wearezeta.atlassian.net/browse/SQSERVICES-1083

Checklist

  • The PR Title explains the impact of the change.
  • The PR description provides context as to why the change should occur and what the code contributes to that effect. This could also be a link to a JIRA ticket or a Github issue, if there is one.
  • If a cassandra schema migration has been added, I ran make git-add-cassandra-schema to update the cassandra schema documentation.
  • changelog.d contains the following bits of information (details):
    • A file with the changelog entry in one or more suitable sub-sections. The sub-sections are marked by directories inside changelog.d.

@battermann battermann force-pushed the SQSERVICES-1083-separate-access-control-for-guests-and-services branch from 95863d4 to 93f04a6 Compare January 13, 2022 15:45
response contains both access roles

wip

conversion in ToSchema instance

pushed old access roles to the boundaries

wip

schema migration

update brig

wip fix tests

fix golden tests

fix galley integration

fix brig-integration

fix wire-api-federation golden tests

fix problems

update cql schema ref

use to/from access role legacy imported from wire-api

roundtrip for access roles old and new

(re-)added golden test for access role legacy

(re-)added golden test for access role legacy

access role conversion test (fails)

wip

wip

clean up

business logic
@battermann battermann force-pushed the SQSERVICES-1083-separate-access-control-for-guests-and-services branch from 6007754 to 46eecd4 Compare January 17, 2022 14:47
@battermann battermann requested a review from fisx January 17, 2022 15:44
schema
<*> cnvmAccess .= field "access" (array schema)
<*> cnvmAccessRole .= field "access_role" schema
<*> cnvmAccessRoles .= accessRolesSchema
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't this mean that both fields are required? I would use "optional" here and leave a description that explains that the server promises to always deliver both?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is defined in the accessRolesSchema. When we deserialize, at least one of them has to be set, and when we serialize, we return both.

Comment on lines 33 to 34
[ fromLegacyToV2ToLegacy,
fromV2ToLegacyToV2
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
[ fromLegacyToV2ToLegacy,
fromV2ToLegacyToV2
[ acessRoleFromLegacyToV2ToLegacy,
acessRoleFromV2ToLegacyToV2

Copy link
Contributor

Choose a reason for hiding this comment

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

(Also, it's probably much faster if we don't run QC here but enumerate all test cases exhaustively. But I think we should probably resist, and do that more exhaustively once we don't have anything better to do.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like the renaming.
Regarding QC, all wire-api unit tests together take 1.5s to run. I don't see a problem.
Checking properties has the benefit that if we add additional access roles later, they are automatically checked.
We can't ensure exhaustiveness on sets anyway, AFAIK.

Copy link
Contributor

@fisx fisx left a comment

Choose a reason for hiding this comment

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

...

@battermann battermann marked this pull request as ready for review January 18, 2022 12:53
(owner, teamId, []) <- Util.createBindingTeamWithNMembers 0
let createConvWithGuestLink = do
convId <- decodeConvId <$> postTeamConv teamId owner [] (Just "testConversation") [CodeAccess] (Just ActivatedAccessRole) Nothing
convId <- decodeConvId <$> postTeamConv teamId owner [] (Just "testConversation") [CodeAccess] (Just (Set.fromList [TeamMemberAccessRole, NonTeamMemberAccessRole])) Nothing
Copy link
Contributor

Choose a reason for hiding this comment

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

this looks like the module where you can test the new cases (in particular services-not-guests, and guests-not-services). maybe this can be even randomized somehow?

@battermann battermann requested a review from fisx January 18, 2022 16:17
then pure bm
else do
activated <- map User.userId <$> E.lookupActivatedUsers (toList (bmLocals bm))
-- FUTUREWORK: should we also remove non-activated remote users?
Copy link
Contributor

Choose a reason for hiding this comment

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

Federation people: can users joining via a guest link without account be non-local?

@battermann battermann requested a review from fisx January 19, 2022 12:33
Copy link
Contributor

@fisx fisx left a comment

Choose a reason for hiding this comment

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

#2057 should (does?) provide some tests that are essential for #2045, but you may have tested this manually? otherwise LGTM!

\`[team_member]` => `team` - team-only conversation\
\`[team_member, non_team_member, service]` => `activated` - conversation for users who have activated email, phone or SSO and services\
\`[team_member, non_team_member, service, guest]` => `non_activated` - all allowed, no checks.\
\All other configurations of `access_role_v2` are mapped to the smallest superset containing all given access roles."
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make more sense to document the mapping in the deprecated type, then they will be deleted together?

@@ -0,0 +1 @@
Backend now separates conversation access control for guests and services. The old access roles are still supported but it is encouraged to upgrade clients since mapping between the old access roles and the new access roles are is not isomorphic. For more details refer to the API changes changelog, the Swagger docs, or the technical specification.
Copy link
Contributor

Choose a reason for hiding this comment

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

If we already know which versions of clients support this, we should add those here, but I suspect we're not certain yet. Bring up in the next standup?

@fisx fisx mentioned this pull request Jan 25, 2022
4 tasks
@fisx fisx merged commit d1df63f into develop Jan 25, 2022
@fisx fisx deleted the SQSERVICES-1083-separate-access-control-for-guests-and-services branch January 25, 2022 11:38
@fisx fisx mentioned this pull request Jan 27, 2022
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