Skip to content

Commit

Permalink
Merge pull request #3731 from esl/domain-admin-annotations
Browse files Browse the repository at this point in the history
Verified domain admin annotations
  • Loading branch information
JanuszJakubiec authored Aug 16, 2022
2 parents 05eb8f5 + a59756f commit 1b9802b
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion priv/graphql/schemas/admin/domain.gql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type DomainAdminQuery @protected{
@protected(type: GLOBAL)
"Get information about the domain"
domainDetails(domain: String!): Domain
@protected(type: DOMAIN, args: ["user"])
@protected(type: DOMAIN, args: ["domain"])
}

type DomainAdminMutation @protected{
Expand Down
3 changes: 2 additions & 1 deletion priv/graphql/schemas/admin/gdpr.gql
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"Retrieve user's presonal data"
type GdprAdminQuery {
type GdprAdminQuery @protected{
"Retrieves all personal data from MongooseIM for a given user"
retrievePersonalData(username: String!, domain: String!, 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 @@ -4,5 +4,5 @@ Allow admin to generate upload/download URL for a file on user's behalf".
type HttpUploadAdminMutation @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
@protected(type: DOMAIN, args: ["domain"])
@protected(type: DOMAIN, args: ["domain"])
}
4 changes: 3 additions & 1 deletion priv/graphql/schemas/admin/metric.gql
Original file line number Diff line number Diff line change
Expand Up @@ -203,16 +203,18 @@ type MetricAdminQuery @protected{
Name is a list of name segments or an underscore (i.e. path).
"""
getMetrics(name: [String]): [MetricResult]
@protected(type: GLOBAL)
"""
Get metrics without using graphql unions.
Optionally returns only specified keys
(i.e. keys: ["one"] only returns key "one", but not key "count")
"""
getMetricsAsDicts(name: [String], keys: [String]): [MetricDictResult]

@protected(type: GLOBAL)
"""
Gather metrics from multiple nodes.
Optionally returns only from specified nodes.
"""
getClusterMetricsAsDicts(name: [String], keys: [String], nodes: [String]): [MetricNodeResult]
@protected(type: GLOBAL)
}
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{
"Create a MUC room under the given XMPP hostname"
createInstantRoom(mucDomain: String!, name: String!, owner: JID!, nick: String!): MUCRoomDesc
@protected(type: DOMAIN, args: ["mucDomain"])
@protected(type: DOMAIN, args: ["owner"])
"Invite a user to a MUC room"
inviteUser(room: JID!, sender: JID!, recipient: JID!, reason: String): String
@protected(type: DOMAIN, args: ["sender"])
Expand All @@ -16,7 +16,7 @@ type MUCAdminMutation @protected{
@protected(type: DOMAIN, args: ["from"])
"Send a private message to a MUC room user"
sendPrivateMessage(room: JID!, from: FullJID!, toNick: String!, body: String!): String
@protected(type: DOMAIN, args: ["room", "from"])
@protected(type: DOMAIN, args: ["from"])
"Remove a MUC room"
deleteRoom(room: JID!, reason: String): String
@protected(type: DOMAIN, args: ["room"])
Expand Down
8 changes: 4 additions & 4 deletions priv/graphql/schemas/admin/muc_light.gql
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ Allow admin to manage Multi-User Chat Light rooms.
type MUCLightAdminMutation @protected{
"Create a MUC light room under the given XMPP hostname"
createRoom(mucDomain: String!, name: String!, owner: JID!, subject: String!, id: NonEmptyString): Room
@protected(type: DOMAIN, args: ["mucDomain"])
@protected(type: DOMAIN, args: ["owner"])
"Change configuration of a MUC Light room"
changeRoomConfiguration(room: JID!, owner: JID!, name: String!, subject: String!): Room
@protected(type: DOMAIN, args: ["room", "owner"])
@protected(type: DOMAIN, args: ["room"])
"Invite a user to a MUC Light room"
inviteUser(room: JID!, sender: JID!, recipient: JID!): String
@protected(type: DOMAIN, args: ["room", "sender"])
@protected(type: DOMAIN, args: ["sender"])
"Remove a MUC Light room"
deleteRoom(room: JID!): String
@protected(type: DOMAIN, args: ["room"])
Expand All @@ -19,7 +19,7 @@ type MUCLightAdminMutation @protected{
@protected(type: DOMAIN, args: ["room"])
"Send a message to a MUC Light room"
sendMessageToRoom(room: JID!, from: JID!, body: String!): String
@protected(type: DOMAIN, args: ["room", "from"])
@protected(type: DOMAIN, args: ["from"])
"Set the user blocking list"
setBlockingList(user: JID!, items: [BlockingInput!]!): String
@protected(type: DOMAIN, args: ["user"])
Expand Down
2 changes: 2 additions & 0 deletions priv/graphql/schemas/admin/private.gql
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Allow admin to set user's private
type PrivateAdminMutation @protected {
"Set user's private"
setPrivate(user: JID!, elementString: String!): String
@protected(type: DOMAIN, args: ["user"])
}

"""
Expand All @@ -12,4 +13,5 @@ Allow admin to get user's private
type PrivateAdminQuery @protected {
"Get user's private"
getPrivate(user: JID!, element: String!, nameSpace: String!): String
@protected(type: DOMAIN, args: ["user"])
}
6 changes: 4 additions & 2 deletions priv/graphql/schemas/admin/token.gql
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
"""
Allow admin to get and revoke user's auth tokens
"""
Allow admin to get and revoke user's auth tokens
"""
type TokenAdminMutation @protected {
"Request auth token for an user"
requestToken(user: JID!): Token
@protected(type: DOMAIN, args: ["user"])
"Revoke any tokens for an user"
revokeToken(user: JID!): String
@protected(type: DOMAIN, args: ["user"])
}
1 change: 1 addition & 0 deletions priv/graphql/schemas/admin/vcard.gql
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ Allow admin to get user's vcard
type VcardAdminQuery @protected{
"Get user's vcard"
getVcard(user: JID!): Vcard
@protected(type: DOMAIN, args: ["user"])
}

0 comments on commit 1b9802b

Please sign in to comment.