Documentation ¶
Index ¶
- Constants
- Variables
- func CreateGroupChangeFromGroupActions(actions []byte) []byte
- func CreatePromotePendingMemberAction(uuid []byte, group string) []byte
- func GetGroupAuthCredentials(startDay int64, endDay int64) error
- func GetGroupExternalCredential(credential *GroupCredential) (*signalservice.GroupExternalCredential, error)
- func GetGroupV2MembersForGroup(group string) ([]*signalservice.DecryptedMember, error)
- func GetMemberPendingAdminApproval(user *entities.GroupUser, group *GroupV2) *signalservice.DecryptedRequestingMember
- func GetMemberPendingProfileKey(user *entities.GroupUser, group *GroupV2) *signalservice.DecryptedPendingMember
- func GetSourceMember(user *entities.GroupUser, group *GroupV2) *signalservice.DecryptedMember
- func GroupInviteLinkUrl()
- func GroupLinkPassword()
- func HexToUUID(id string) string
- func IsAccessRequiredOneOf(valueToTest signalservice.AccessControl_AccessRequired, ...) bool
- func IsMember(user *entities.GroupUser, group *GroupV2) bool
- func IsMemberPendingAdminApproval(user *entities.GroupUser, group *GroupV2) bool
- func IsMemberPendingProfileKey(user *entities.GroupUser, group *GroupV2) bool
- func PatchGroupV2(out []byte, groupsV2Authorization *GroupsV2Authorization) error
- func SetupGroups(path string) error
- type GroupChangeApplicator
- func (g *GroupChangeApplicator) ApplyAddMembers(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, ...) error
- func (g *GroupChangeApplicator) ApplyAddMembersPendingAdminApproval(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, ...) error
- func (g *GroupChangeApplicator) ApplyAddMembersPendingProfileKeys(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, ...) error
- func (g *GroupChangeApplicator) ApplyDeleteMembers(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, ...) error
- func (g *GroupChangeApplicator) ApplyDeleteMembersPendingAdminApproval(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, ...) error
- func (g *GroupChangeApplicator) ApplyDeleteMembersPendingProfileKey(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, ...) error
- func (g *GroupChangeApplicator) ApplyModifyAddFromInviteLinkAccess(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, ...) error
- func (g *GroupChangeApplicator) ApplyModifyAnnouncementsOnly(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, ...) error
- func (g *GroupChangeApplicator) ApplyModifyAttributesAccess(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, ...) error
- func (g *GroupChangeApplicator) ApplyModifyAvatar(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, ...) error
- func (g *GroupChangeApplicator) ApplyModifyDescription(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, ...) error
- func (g *GroupChangeApplicator) ApplyModifyDisappearingMessageTimer(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, ...) error
- func (g *GroupChangeApplicator) ApplyModifyInviteLinkPassword(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, ...) error
- func (g *GroupChangeApplicator) ApplyModifyMemberProfileKeys(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, ...) error
- func (g *GroupChangeApplicator) ApplyModifyMemberRoles(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, ...) error
- func (g *GroupChangeApplicator) ApplyModifyMembersAccess(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, ...) error
- func (g *GroupChangeApplicator) ApplyModifyTitle(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, ...) error
- func (g *GroupChangeApplicator) ApplyPromoteMembersPendingProfileKey(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, ...) error
- func (g *GroupChangeApplicator) ApplyPromotePendingAdminApproval(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, ...) error
- type GroupCredential
- type GroupCredentials
- type GroupExternalCredential
- type GroupV2
- func (g *GroupV2) AddPendingMembers(uuid []byte) error
- func (g *GroupV2) CheckJoinStatus() error
- func (g *GroupV2) EncryptUUID(uuid []byte) ([]byte, error)
- func (g *GroupV2) JoinGroup() error
- func (g *GroupV2) ModifyGroup(user *entities.GroupUser, params ModifyGroupParams, ...) (*entities.Resp, error)
- func (g *GroupV2) UpdateGroupFromServer() error
- type GroupV2MessageContext
- type GroupValidator
- func (g *GroupValidator) IsValidAvatarUrl(url string, groupId []byte) bool
- func (g *GroupValidator) ValidateAccessControl(group *signalservice.DecryptedGroup) error
- func (g *GroupValidator) ValidateAddMember(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, ...) error
- func (g *GroupValidator) ValidateAddMembersPendingAdminApproval(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, ...) error
- func (g *GroupValidator) ValidateAddMembersPendingProfileKey(user *entities.GroupUser, group *GroupV2, ...) error
- func (g *GroupValidator) ValidateFinalGroupState(group *signalservice.DecryptedGroup) error
- func (g *GroupValidator) ValidateMember(group *GroupV2, member *signalservice.Member, publicKey []byte) (*signalservice.Member, error)
- func (g *GroupValidator) ValidateMemberPendingAdminApproval(user *entities.GroupUser, group *GroupV2, ...) (*signalservice.RequestingMember, error)
- func (g *GroupValidator) ValidateMemberPendingProfileKey(group *GroupV2, member *signalservice.DecryptedMember, ...) (*signalservice.PendingMember, error)
- func (g *GroupValidator) ValidatePresentationUpdate(source *entities.GroupUser, group *GroupV2, presentationData []byte) (zkgroup.ProfileKeyCredentialPresentation, error)
- func (g *GroupValidator) ValidateRoles(group *signalservice.DecryptedGroup) error
- type GroupsV2Authorization
- type ModifyGroupParams
Constants ¶
View Source
const ( GROUPSV2_CREDENTIAL = "/v1/certificate/group/%d/%d" GROUPSV2_TOKEN = "/v1/groups/token" )
View Source
const ( HIGHEST_KNOWN_EPOCH = 1 GROUPSV2_GROUP = "/v1/groups/" GROUPSV2_GROUP_JOIN = "/v1/groups/join/%s" )
View Source
const ( GroupV2JoinsStatusMember = 0 GroupV2JoinsStatusInvite = 1 GroupV2JoinsStatusRequest = 2 GroupV2JoinsStatusRemoved = 3 )
Variables ¶
View Source
var INVITE_LINK_PASSWORD_SIZE_BYTES = 16
Functions ¶
func CreateGroupChangeFromGroupActions ¶ added in v1.3.0
func CreatePromotePendingMemberAction ¶ added in v1.3.0
func GetGroupAuthCredentials ¶ added in v1.3.0
func GetGroupExternalCredential ¶ added in v1.7.0
func GetGroupExternalCredential(credential *GroupCredential) (*signalservice.GroupExternalCredential, error)
func GetGroupV2MembersForGroup ¶ added in v1.16.0
func GetGroupV2MembersForGroup(group string) ([]*signalservice.DecryptedMember, error)
func GetMemberPendingAdminApproval ¶ added in v1.6.0
func GetMemberPendingAdminApproval(user *entities.GroupUser, group *GroupV2) *signalservice.DecryptedRequestingMember
func GetMemberPendingProfileKey ¶ added in v1.6.0
func GetMemberPendingProfileKey(user *entities.GroupUser, group *GroupV2) *signalservice.DecryptedPendingMember
func GetSourceMember ¶ added in v1.6.0
func GetSourceMember(user *entities.GroupUser, group *GroupV2) *signalservice.DecryptedMember
func GroupInviteLinkUrl ¶ added in v1.3.0
func GroupInviteLinkUrl()
func GroupLinkPassword ¶ added in v1.3.0
func GroupLinkPassword()
func IsAccessRequiredOneOf ¶ added in v1.6.0
func IsAccessRequiredOneOf(valueToTest signalservice.AccessControl_AccessRequired, acceptableValues ...signalservice.AccessControl_AccessRequired) bool
func IsMemberPendingAdminApproval ¶ added in v1.6.0
func IsMemberPendingProfileKey ¶ added in v1.6.0
func PatchGroupV2 ¶ added in v1.3.0
func PatchGroupV2(out []byte, groupsV2Authorization *GroupsV2Authorization) error
func SetupGroups ¶ added in v1.3.0
Types ¶
type GroupChangeApplicator ¶ added in v1.6.0
type GroupChangeApplicator struct {
// contains filtered or unexported fields
}
func NewGroupChangeApplicator ¶ added in v1.6.0
func NewGroupChangeApplicator(g *GroupValidator) *GroupChangeApplicator
func (*GroupChangeApplicator) ApplyAddMembers ¶ added in v1.6.0
func (g *GroupChangeApplicator) ApplyAddMembers(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, addMembers []*signalservice.GroupChange_Actions_AddMemberAction, groupImmut *GroupV2) error
func (*GroupChangeApplicator) ApplyAddMembersPendingAdminApproval ¶ added in v1.6.0
func (g *GroupChangeApplicator) ApplyAddMembersPendingAdminApproval(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, actions []*signalservice.GroupChange_Actions_AddRequestingMemberAction, groupImmut *GroupV2) error
func (*GroupChangeApplicator) ApplyAddMembersPendingProfileKeys ¶ added in v1.6.0
func (g *GroupChangeApplicator) ApplyAddMembersPendingProfileKeys(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, addMembersPendingProfileKeys []*signalservice.GroupChange_Actions_AddPendingMemberAction, groupImmut *GroupV2) error
func (*GroupChangeApplicator) ApplyDeleteMembers ¶ added in v1.6.0
func (g *GroupChangeApplicator) ApplyDeleteMembers(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, deleteMembers []*signalservice.GroupChange_Actions_DeleteMemberAction, groupImmut *GroupV2) error
func (*GroupChangeApplicator) ApplyDeleteMembersPendingAdminApproval ¶ added in v1.6.0
func (g *GroupChangeApplicator) ApplyDeleteMembersPendingAdminApproval(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, actions []*signalservice.GroupChange_Actions_DeleteRequestingMemberAction, groupImmut *GroupV2) error
func (*GroupChangeApplicator) ApplyDeleteMembersPendingProfileKey ¶ added in v1.6.0
func (g *GroupChangeApplicator) ApplyDeleteMembersPendingProfileKey(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, deleteMembersPendingProfileKeys []*signalservice.GroupChange_Actions_DeletePendingMemberAction, groupImmut *GroupV2) error
func (*GroupChangeApplicator) ApplyModifyAddFromInviteLinkAccess ¶ added in v1.6.0
func (g *GroupChangeApplicator) ApplyModifyAddFromInviteLinkAccess(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, action *signalservice.GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction, groupImmut *GroupV2) error
func (*GroupChangeApplicator) ApplyModifyAnnouncementsOnly ¶ added in v1.6.0
func (g *GroupChangeApplicator) ApplyModifyAnnouncementsOnly(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, action *signalservice.GroupChange_Actions_ModifyAnnouncementsOnlyAction, groupImmut *GroupV2) error
func (*GroupChangeApplicator) ApplyModifyAttributesAccess ¶ added in v1.6.0
func (g *GroupChangeApplicator) ApplyModifyAttributesAccess(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, modifyAttributesAccess *signalservice.GroupChange_Actions_ModifyAttributesAccessControlAction, groupImmut *GroupV2) error
func (*GroupChangeApplicator) ApplyModifyAvatar ¶ added in v1.6.0
func (g *GroupChangeApplicator) ApplyModifyAvatar(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, modifyAvatar *signalservice.GroupChange_Actions_ModifyAvatarAction, groupImmut *GroupV2) error
func (*GroupChangeApplicator) ApplyModifyDescription ¶ added in v1.6.0
func (g *GroupChangeApplicator) ApplyModifyDescription(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, action *signalservice.GroupChange_Actions_ModifyDescriptionAction, groupImmut *GroupV2) error
func (*GroupChangeApplicator) ApplyModifyDisappearingMessageTimer ¶ added in v1.6.0
func (g *GroupChangeApplicator) ApplyModifyDisappearingMessageTimer(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, modifyDisappearingMessageTimer *signalservice.GroupChange_Actions_ModifyDisappearingMessagesTimerAction, groupImmut *GroupV2) error
func (*GroupChangeApplicator) ApplyModifyInviteLinkPassword ¶ added in v1.6.0
func (g *GroupChangeApplicator) ApplyModifyInviteLinkPassword(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, action *signalservice.GroupChange_Actions_ModifyInviteLinkPasswordAction, groupImmut *GroupV2) error
func (*GroupChangeApplicator) ApplyModifyMemberProfileKeys ¶ added in v1.6.0
func (g *GroupChangeApplicator) ApplyModifyMemberProfileKeys(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, modifyMembers []*signalservice.GroupChange_Actions_ModifyMemberProfileKeyAction, groupImmut *GroupV2) error
func (*GroupChangeApplicator) ApplyModifyMemberRoles ¶ added in v1.6.0
func (g *GroupChangeApplicator) ApplyModifyMemberRoles(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, modifyMembers []*signalservice.GroupChange_Actions_ModifyMemberRoleAction, groupImmut *GroupV2) error
func (*GroupChangeApplicator) ApplyModifyMembersAccess ¶ added in v1.6.0
func (g *GroupChangeApplicator) ApplyModifyMembersAccess(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, modifyMembersAccess *signalservice.GroupChange_Actions_ModifyMembersAccessControlAction, groupImmut *GroupV2) error
func (*GroupChangeApplicator) ApplyModifyTitle ¶ added in v1.6.0
func (g *GroupChangeApplicator) ApplyModifyTitle(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, modifyTitle *signalservice.GroupChange_Actions_ModifyTitleAction, groupImmut *GroupV2) error
func (*GroupChangeApplicator) ApplyPromoteMembersPendingProfileKey ¶ added in v1.6.0
func (g *GroupChangeApplicator) ApplyPromoteMembersPendingProfileKey(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, promoteMembersPendingProfileKeys []*signalservice.GroupChange_Actions_PromotePendingMemberAction, groupImmut *GroupV2) error
func (*GroupChangeApplicator) ApplyPromotePendingAdminApproval ¶ added in v1.6.0
func (g *GroupChangeApplicator) ApplyPromotePendingAdminApproval(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, actions []*signalservice.GroupChange_Actions_PromoteRequestingMemberAction, groupImmut *GroupV2) error
type GroupCredential ¶ added in v1.3.0
func GetCredentialForRedemption ¶ added in v1.3.0
func GetCredentialForRedemption(day int64) (*GroupCredential, error)
func GetCredentialForToday ¶ added in v1.3.0
func GetCredentialForToday() (*GroupCredential, error)
type GroupCredentials ¶ added in v1.3.0
type GroupCredentials struct {
Credentials []GroupCredential `json:"credentials"`
}
var Credentials *GroupCredentials
type GroupExternalCredential ¶ added in v1.7.0
type GroupExternalCredential struct {
Token []byte `json:"token"`
}
type GroupV2 ¶ added in v1.3.0
type GroupV2 struct { MasterKey []byte Hexid string GroupContext signalservice.Group DecryptedGroup *signalservice.DecryptedGroup GroupAction *signalservice.DecryptedGroupChange JoinStatus int Revision uint32 AnnouncementsOnly bool // contains filtered or unexported fields }
GroupV2 holds group metadata.
func HandleGroupsV2 ¶ added in v1.3.0
func HandleGroupsV2(src string, dm *signalservice.DataMessage) (*GroupV2, error)
func (*GroupV2) AddPendingMembers ¶ added in v1.6.0
func (*GroupV2) CheckJoinStatus ¶ added in v1.3.0
todo handle group join requests via link
func (*GroupV2) EncryptUUID ¶ added in v1.7.0
func (*GroupV2) ModifyGroup ¶ added in v1.6.0
func (g *GroupV2) ModifyGroup(user *entities.GroupUser, params ModifyGroupParams, submittedActions *signalservice.GroupChange_Actions) (*entities.Resp, error)
func (*GroupV2) UpdateGroupFromServer ¶ added in v1.3.0
type GroupV2MessageContext ¶ added in v1.3.0
type GroupV2MessageContext struct { MasterKey []byte // Masterkey is the unique identifier Revision uint32 // holds the current revision number, if mismatch fetch the steps in between GroupChange []byte // protobuf of signalservice.GroupChange }
GroupV2Message defines a group v2 message type
type GroupValidator ¶ added in v1.6.0
type GroupValidator struct {
// contains filtered or unexported fields
}
func NewGroupValidator ¶ added in v1.6.0
func NewGroupValidator(profileOp *zkgroup.ServerZkProfileOperations, config *config.Config) *GroupValidator
func (*GroupValidator) IsValidAvatarUrl ¶ added in v1.6.0
func (g *GroupValidator) IsValidAvatarUrl(url string, groupId []byte) bool
func (*GroupValidator) ValidateAccessControl ¶ added in v1.6.0
func (g *GroupValidator) ValidateAccessControl(group *signalservice.DecryptedGroup) error
func (*GroupValidator) ValidateAddMember ¶ added in v1.6.0
func (g *GroupValidator) ValidateAddMember(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, actions []*signalservice.GroupChange_Actions_AddMemberAction, groupPublicKey []byte) error
func (*GroupValidator) ValidateAddMembersPendingAdminApproval ¶ added in v1.6.0
func (g *GroupValidator) ValidateAddMembersPendingAdminApproval(user *entities.GroupUser, inviteLinkPassword []byte, group *GroupV2, actions []*signalservice.GroupChange_Actions_AddRequestingMemberAction) error
func (*GroupValidator) ValidateAddMembersPendingProfileKey ¶ added in v1.6.0
func (g *GroupValidator) ValidateAddMembersPendingProfileKey(user *entities.GroupUser, group *GroupV2, actions []*signalservice.GroupChange_Actions_AddPendingMemberAction) error
func (*GroupValidator) ValidateFinalGroupState ¶ added in v1.6.0
func (g *GroupValidator) ValidateFinalGroupState(group *signalservice.DecryptedGroup) error
func (*GroupValidator) ValidateMember ¶ added in v1.6.0
func (g *GroupValidator) ValidateMember(group *GroupV2, member *signalservice.Member, publicKey []byte) (*signalservice.Member, error)
func (*GroupValidator) ValidateMemberPendingAdminApproval ¶ added in v1.6.0
func (g *GroupValidator) ValidateMemberPendingAdminApproval(user *entities.GroupUser, group *GroupV2, memberPendingAdminApproval *signalservice.RequestingMember) (*signalservice.RequestingMember, error)
func (*GroupValidator) ValidateMemberPendingProfileKey ¶ added in v1.6.0
func (g *GroupValidator) ValidateMemberPendingProfileKey(group *GroupV2, member *signalservice.DecryptedMember, memberPendingProfileKey *signalservice.PendingMember) (*signalservice.PendingMember, error)
func (*GroupValidator) ValidatePresentationUpdate ¶ added in v1.6.0
func (g *GroupValidator) ValidatePresentationUpdate(source *entities.GroupUser, group *GroupV2, presentationData []byte) (zkgroup.ProfileKeyCredentialPresentation, error)
func (*GroupValidator) ValidateRoles ¶ added in v1.6.0
func (g *GroupValidator) ValidateRoles(group *signalservice.DecryptedGroup) error
type GroupsV2Authorization ¶
func NewGroupsV2Authorization ¶
func NewGroupsV2Authorization(uuid []byte, groupSecretParams zkgroup.GroupSecretParams) (*GroupsV2Authorization, error)
func NewGroupsV2AuthorizationForGroup ¶
func NewGroupsV2AuthorizationForGroup(uuid []byte, hexid string) (*GroupsV2Authorization, error)
type ModifyGroupParams ¶ added in v1.7.0
type ModifyGroupParams struct {
InviteLinkPassword string `form:"inviteLinkPassword,optional"`
}
Click to show internal directories.
Click to hide internal directories.