Skip to content

Commit

Permalink
Use DomainType to stringprep the domain
Browse files Browse the repository at this point in the history
  • Loading branch information
chrzaszcz committed Nov 16, 2022
1 parent fa7e97a commit 0125408
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions priv/graphql/schemas/admin/account.gql
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ Allow admin to get information about accounts.
"""
type AccountAdminQuery @protected{
"List users per domain"
listUsers(domain: String!): [String!]
listUsers(domain: DomainName!): [String!]
@protected(type: DOMAIN, args: ["domain"])
"Get number of users per domain"
countUsers(domain: String!): Int
countUsers(domain: DomainName!): Int
@protected(type: DOMAIN, args: ["domain"])
"Check if a password is correct"
checkPassword(user: JID!, password: String!): CheckPasswordPayload
Expand All @@ -24,7 +24,7 @@ Allow admin to manage user accounts.
"""
type AccountAdminMutation @protected{
"Register a user. Username will be generated when skipped"
registerUser(domain: String!, username: String, password: String!): UserPayload
registerUser(domain: DomainName!, username: String, password: String!): UserPayload
@protected(type: DOMAIN, args: ["domain"])
"Remove the user's account along with all the associated personal data"
removeUser(user: JID!): UserPayload
Expand Down
2 changes: 1 addition & 1 deletion priv/graphql/schemas/admin/admin_auth_status.gql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"Information about user request authorization"
type AdminAuthInfo{
"Authorized for a domain"
domain: String
domain: DomainName
"Authorization status"
authStatus: AuthStatus!
"Authorization as a "
Expand Down
2 changes: 1 addition & 1 deletion priv/graphql/schemas/admin/gdpr.gql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"Retrieve user's presonal data"
type GdprAdminQuery @protected{
"Retrieves all personal data from MongooseIM for a given user"
retrievePersonalData(username: String!, domain: String!, resultFilepath: String!): String
retrievePersonalData(username: String!, domain: DomainName!, resultFilepath: String!): String
@protected(type: DOMAIN, args: ["domain"])
}
2 changes: 1 addition & 1 deletion priv/graphql/schemas/admin/http_upload.gql
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ Allow admin to generate upload/download URL for a file on user's behalf".
"""
type HttpUploadAdminMutation @use(modules: ["mod_http_upload"]) @protected{
"Allow admin to generate upload/download URLs for a file on user's behalf"
getUrl(domain: String!, filename: String!, size: Int!, contentType: String!, timeout: Int!): FileUrls
getUrl(domain: DomainName!, filename: String!, size: Int!, contentType: String!, timeout: Int!): FileUrls
@use(arg: "domain") @protected(type: DOMAIN, args: ["domain"])
}
2 changes: 1 addition & 1 deletion priv/graphql/schemas/admin/inbox.gql
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type InboxAdminMutation @use(modules: ["mod_inbox"]) @protected{
"Flush the whole domain bin and return the number of deleted rows"
flushDomainBin(
"Domain to be cleared"
domain: String!,
domain: DomainName!,
"Remove older than given days or all if null"
days: PosInt
): Int @use(arg: "domain") @protected(type: DOMAIN, args: ["domain"])
Expand Down
6 changes: 3 additions & 3 deletions priv/graphql/schemas/admin/last.gql
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ type LastAdminQuery @use(modules: ["mod_last"]) @protected{
getLast(user: JID!): LastActivity
@use(arg: "user") @protected(type: DOMAIN, args: ["user"])
"Get the number of users active from the given timestamp"
countActiveUsers(domain: String!, timestamp: DateTime): Int
countActiveUsers(domain: DomainName!, timestamp: DateTime): Int
@use(arg: "domain") @protected(type: DOMAIN, args: ["domain"])
"""
List users that didn't log in the last days or have never logged in.
Globally or for a specified domain
"""
listOldUsers(domain: String, timestamp: DateTime!): [OldUser!]
listOldUsers(domain: DomainName, timestamp: DateTime!): [OldUser!]
@use(arg: "domain") @protected(type: DOMAIN, args: ["domain"])
}

Expand All @@ -27,7 +27,7 @@ type LastAdminMutation @use(modules: ["mod_last"]) @protected{
Delete users that didn't log in the last days or have never logged in.
Globally or for a specified domain. Please use listOldUsers to check which users will be deleted
"""
removeOldUsers(domain: String, timestamp: DateTime!): [OldUser!]
removeOldUsers(domain: DomainName, timestamp: DateTime!): [OldUser!]
@use(arg: "domain") @protected(type: DOMAIN, args: ["domain"])
}

Expand Down
4 changes: 2 additions & 2 deletions priv/graphql/schemas/admin/muc.gql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Allow admin to manage Multi-User Chat rooms.
type MUCAdminMutation @protected @use(modules: ["mod_muc"]){
"Create a MUC room under the given XMPP hostname"
#There is no @use directive because it is currently impossible to get HostType from mucDomain in directive code
createInstantRoom(mucDomain: String!, name: String!, owner: JID!, nick: String!): MUCRoomDesc
createInstantRoom(mucDomain: DomainName!, name: String!, owner: JID!, nick: String!): MUCRoomDesc
@protected(type: DOMAIN, args: ["owner"])
"Invite a user to a MUC room"
inviteUser(room: JID!, sender: JID!, recipient: JID!, reason: String): String
Expand Down Expand Up @@ -44,7 +44,7 @@ Allow admin to get information about Multi-User Chat rooms.
type MUCAdminQuery @protected @use(modules: ["mod_muc"]){
"Get MUC rooms under the given MUC domain"
#There is no @use directive because it is currently impossible to get HostType from mucDomain in directive code
listRooms(mucDomain: String!, from: JID!, limit: Int, index: Int): MUCRoomsPayload!
listRooms(mucDomain: DomainName!, from: JID!, limit: Int, index: Int): MUCRoomsPayload!
@protected(type: DOMAIN, args: ["from"])
"Get configuration of the MUC room"
getRoomConfig(room: JID!): MUCRoomConfig
Expand Down
2 changes: 1 addition & 1 deletion priv/graphql/schemas/admin/muc_light.gql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Allow admin to manage Multi-User Chat Light rooms.
type MUCLightAdminMutation @use(modules: ["mod_muc_light"]) @protected{
"Create a MUC light room under the given XMPP hostname"
#There is no @use directive because it is currently impossible to get HostType from mucDomain in directive code
createRoom(mucDomain: String!, name: String!, owner: JID!, subject: String!, id: NonEmptyString, options: [RoomConfigDictEntryInput!]): Room
createRoom(mucDomain: DomainName!, name: String!, owner: JID!, subject: String!, id: NonEmptyString, options: [RoomConfigDictEntryInput!]): Room
@protected(type: DOMAIN, args: ["owner"])
"Change configuration of a MUC Light room"
changeRoomConfiguration(room: JID!, owner: JID!, name: String!, subject: String!, options: [RoomConfigDictEntryInput!]): Room
Expand Down
4 changes: 2 additions & 2 deletions priv/graphql/schemas/admin/offline.gql
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Allow admin to delete offline messages from specified domain
"""
type OfflineAdminMutation @protected @use(modules: ["mod_offline"]){
"Delete offline messages whose date has expired"
deleteExpiredMessages(domain: String!): String @use(arg: "domain")
deleteExpiredMessages(domain: DomainName!): String @use(arg: "domain")
@protected(type: DOMAIN, args: ["domain"])
"Delete messages at least as old as the number of days specified in the parameter"
deleteOldMessages(domain: String!, days: Int!): String
deleteOldMessages(domain: DomainName!, days: Int!): String
@protected(type: DOMAIN, args: ["domain"]) @use(arg: "domain")
}
4 changes: 2 additions & 2 deletions priv/graphql/schemas/user/muc.gql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Allow user to manage Multi-User Chat rooms.
type MUCUserMutation @protected @use(modules: ["mod_muc"]){
"Create a MUC room under the given XMPP hostname"
#There is no @use directive because it is currently impossible to get HostType from mucDomain in directive code
createInstantRoom(mucDomain: String!, name: String!, nick: String!): MUCRoomDesc
createInstantRoom(mucDomain: DomainName!, name: String!, nick: String!): MUCRoomDesc
"Invite a user to a MUC room"
inviteUser(room: JID!, recipient: JID!, reason: String): String @use(arg: "room")
"Kick a user from a MUC room"
Expand Down Expand Up @@ -33,7 +33,7 @@ Allow user to get information about Multi-User Chat rooms.
type MUCUserQuery @protected @use(modules: ["mod_muc"]){
"Get MUC rooms under the given MUC domain"
#There is no @use directive because it is currently impossible to get HostType from mucDomain in directive code
listRooms(mucDomain: String!, limit: Int, index: Int): MUCRoomsPayload!
listRooms(mucDomain: DomainName!, limit: Int, index: Int): MUCRoomsPayload!
"Get configuration of the MUC room"
getRoomConfig(room: JID!): MUCRoomConfig @use(arg: "room")
"Get the user list of a given MUC room"
Expand Down
2 changes: 1 addition & 1 deletion priv/graphql/schemas/user/muc_light.gql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Allow user to manage Multi-User Chat Light rooms.
type MUCLightUserMutation @protected @use(modules: ["mod_muc_light"]){
"Create a MUC light room under the given XMPP hostname"
#There is no @use directive because it is currently impossible to get HostType from mucDomain in directive code
createRoom(mucDomain: String!, name: String!, subject: String!, id: NonEmptyString, options: [RoomConfigDictEntryInput!]): Room
createRoom(mucDomain: DomainName!, name: String!, subject: String!, id: NonEmptyString, options: [RoomConfigDictEntryInput!]): Room
"Change configuration of a MUC Light room"
changeRoomConfiguration(room: JID!, name: String!, subject: String!, options: [RoomConfigDictEntryInput!]): Room @use(arg: "room")
"Invite a user to a MUC Light room"
Expand Down

0 comments on commit 0125408

Please sign in to comment.