-
Notifications
You must be signed in to change notification settings - Fork 334
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add Mattermost Plugin IntegrationProvider (#10361)
- Loading branch information
1 parent
9ddd5e5
commit b5bd2b4
Showing
11 changed files
with
180 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
packages/server/graphql/public/typeDefs/IntegrationProviderMetadataInputSharedSecret.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
""" | ||
Shared secret provider metadata | ||
""" | ||
input IntegrationProviderMetadataInputSharedSecret { | ||
""" | ||
The base URL used to access the provider | ||
""" | ||
serverBaseUrl: URL! | ||
|
||
""" | ||
Shared secret between Parabol and the provider | ||
""" | ||
sharedSecret: String! | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
packages/server/graphql/types/IntegrationProviderMetadataInputSharedSecret.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import {GraphQLInputObjectType, GraphQLNonNull, GraphQLString} from 'graphql' | ||
import GraphQLURLType from './GraphQLURLType' | ||
|
||
export interface IIntegrationProviderMetadataInputSharedSecret { | ||
serverBaseUrl: string | ||
sharedSecret: string | ||
} | ||
export const IntegrationProviderMetadataInputSharedSecret = new GraphQLInputObjectType({ | ||
name: 'IntegrationProviderMetadataInputSharedSecret', | ||
description: 'Webhook provider metadata', | ||
fields: () => ({ | ||
serverBaseUrl: { | ||
type: new GraphQLNonNull(GraphQLURLType), | ||
description: 'The base URL used to access the provider' | ||
}, | ||
sharedSecret: { | ||
type: new GraphQLNonNull(GraphQLString), | ||
description: 'Shared secret between Parabol and the provider' | ||
} | ||
}) | ||
}) | ||
|
||
export default IntegrationProviderMetadataInputSharedSecret |
24 changes: 24 additions & 0 deletions
24
packages/server/graphql/types/IntegrationProviderSharedSecret.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import {GraphQLNonNull, GraphQLObjectType, GraphQLString} from 'graphql' | ||
import {GQLContext} from '../graphql' | ||
import GraphQLURLType from './GraphQLURLType' | ||
import IntegrationProvider, {integrationProviderFields} from './IntegrationProvider' | ||
|
||
const IntegrationProviderSharedSecret = new GraphQLObjectType<any, GQLContext>({ | ||
name: 'IntegrationProviderSharedSecret', | ||
description: 'An integration provider that connects via a shared secret', | ||
interfaces: () => [IntegrationProvider], | ||
isTypeOf: ({authStrategy}) => authStrategy === 'sharedSecret', | ||
fields: () => ({ | ||
...integrationProviderFields(), | ||
serverBaseUrl: { | ||
type: new GraphQLNonNull(GraphQLURLType), | ||
description: 'The base URL of the OAuth1 server' | ||
}, | ||
sharedSecret: { | ||
type: new GraphQLNonNull(GraphQLString), | ||
description: 'The shared secret used to sign requests' | ||
} | ||
}) | ||
}) | ||
|
||
export default IntegrationProviderSharedSecret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters