-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(backend): add generated Go client (#57)
Signed-off-by: David van der Spek <[email protected]>
- Loading branch information
Showing
11 changed files
with
14,290 additions
and
53 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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
generate: | ||
clientV2: true # Generate a Client that provides a new signature | ||
clientInterfaceName: "TraceShieldGraphQLClient" # Determine the name of the generated client interface | ||
model: | ||
package: gqlclient | ||
filename: generated/client/models_gen.go # https://github.com/99designs/gqlgen/tree/master/plugin/modelgen | ||
client: | ||
package: gqlclient | ||
filename: generated/client/client.go # Where should any generated client go? | ||
models: | ||
Int: | ||
model: github.com/99designs/gqlgen/graphql.Int64 | ||
Date: | ||
model: github.com/99designs/gqlgen/graphql.Time | ||
ID: | ||
model: github.com/99designs/gqlgen/graphql.ID | ||
String: | ||
model: github.com/99designs/gqlgen/graphql.String | ||
Float: | ||
model: | ||
- github.com/99designs/gqlgen/graphql.Float | ||
Duration: | ||
model: | ||
- github.com/pluralsh/trace-shield/graph/custom.Duration | ||
FloatMap: | ||
model: | ||
- github.com/pluralsh/trace-shield/graph/custom.FloatMap | ||
ForwardingRuleMap: | ||
model: | ||
- github.com/pluralsh/trace-shield/graph/custom.ForwardingRuleMap | ||
schema: | ||
- "graph/*.graphqls" # Where are all the schema files located? | ||
query: | ||
- "query/*.graphqls" # Where are all the query files located? |
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 @@ | ||
query ListGroups { # TODO: we should also support getting a single group | ||
listGroups { | ||
...GroupFragment | ||
} | ||
} | ||
|
||
mutation UpdateGroup($name: String!, $members: [String!]) { # TODO: for consistency we should probably split create and update mutations | ||
group(name: $name, members: $members) { | ||
...GroupFragment | ||
} | ||
} | ||
|
||
mutation DeleteGroup($name: String!) { | ||
deleteGroup(name: $name) { | ||
name | ||
} | ||
} | ||
|
||
fragment GroupFragment on Group { | ||
name | ||
members { | ||
...UserFragmentNoGroups | ||
} | ||
} |
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,227 @@ | ||
query ListOAuth2Clients() { | ||
listOAuth2Clients { | ||
...OAuth2ClientFragment | ||
} | ||
} | ||
|
||
query GetOAuth2Client($clientId: ID!) { | ||
getOAuth2Client(clientId: $clientId) { | ||
...OAuth2ClientFragment | ||
} | ||
} | ||
|
||
mutation DeleteOAuth2Client($clientId: String!) { | ||
deleteOAuth2Client(clientId: $clientId) { | ||
clientId | ||
} | ||
} | ||
|
||
mutation UpdateOAuth2Client( | ||
$allowedCorsOrigins: [String!] | ||
$audience:[String!] | ||
$authorizationCodeGrantAccessTokenLifespan: String | ||
$authorizationCodeGrantIdTokenLifespan: String | ||
$authorizationCodeGrantRefreshTokenLifespan: String | ||
$backChannelLogoutSessionRequired: Boolean | ||
$backChannelLogoutUri: String | ||
$clientCredentialsGrantAccessTokenLifespan: String | ||
$clientId: String! | ||
$clientName: String | ||
$clientSecret: String | ||
$ClientSecretExpiresAt: Int | ||
$clientUri: String | ||
$contacts: [String!] | ||
$frontchannelLogoutSessionRequired: Boolean | ||
$frontchannelLogoutUri: String | ||
$grantTypes: [String!] | ||
$implicitGrantAccessTokenLifespan: String | ||
$implicitGrantIdTokenLifespan: String | ||
$jwks: Map | ||
$jwksUri: String | ||
$jwtBearerGrantAccessTokenLifespan: String | ||
$logoUri: String | ||
$metadata: Map | ||
$policyUri: String | ||
$postLogoutRedirectUris: [String!] | ||
$redirectUris: [String!] | ||
$responseTypes: [String!] | ||
$scope: String | ||
$sectorIdentifierUri: String | ||
$subjectType: String | ||
$tokenEndpointAuthMethod: String | ||
$tokenEndpointAuthSigningAlgorithm: String | ||
$tosUri: String | ||
$userinfoSignedResponseAlgorithm: String | ||
$loginBindings: LoginBindingsInput | ||
) { | ||
updateOAuth2Client( | ||
allowedCorsOrigins: $allowedCorsOrigins | ||
audience: $audience | ||
authorizationCodeGrantAccessTokenLifespan: $authorizationCodeGrantAccessTokenLifespan | ||
authorizationCodeGrantIdTokenLifespan: $authorizationCodeGrantIdTokenLifespan | ||
authorizationCodeGrantRefreshTokenLifespan: $authorizationCodeGrantRefreshTokenLifespan | ||
backChannelLogoutSessionRequired: $backChannelLogoutSessionRequired | ||
backChannelLogoutUri: $backChannelLogoutUri | ||
clientCredentialsGrantAccessTokenLifespan: $clientCredentialsGrantAccessTokenLifespan | ||
clientId: $clientId | ||
clientName: $clientName | ||
clientSecret: $clientSecret | ||
ClientSecretExpiresAt: $ClientSecretExpiresAt | ||
clientUri: $clientUri | ||
contacts: $contacts | ||
frontchannelLogoutSessionRequired: $frontchannelLogoutSessionRequired | ||
frontchannelLogoutUri: $frontchannelLogoutUri | ||
grantTypes: $grantTypes | ||
implicitGrantAccessTokenLifespan: $implicitGrantAccessTokenLifespan | ||
implicitGrantIdTokenLifespan: $implicitGrantIdTokenLifespan | ||
jwks: $jwks | ||
jwksUri: $jwksUri | ||
jwtBearerGrantAccessTokenLifespan: $jwtBearerGrantAccessTokenLifespan | ||
logoUri: $logoUri | ||
metadata: $metadata | ||
policyUri: $policyUri | ||
postLogoutRedirectUris: $postLogoutRedirectUris | ||
redirectUris: $redirectUris | ||
responseTypes: $responseTypes | ||
scope: $scope | ||
sectorIdentifierUri: $sectorIdentifierUri | ||
subjectType: $subjectType | ||
tokenEndpointAuthMethod: $tokenEndpointAuthMethod | ||
tokenEndpointAuthSigningAlgorithm: $tokenEndpointAuthSigningAlgorithm | ||
tosUri: $tosUri | ||
userinfoSignedResponseAlgorithm: $userinfoSignedResponseAlgorithm | ||
loginBindings: $loginBindings | ||
) { | ||
...OAuth2ClientFragment | ||
} | ||
} | ||
|
||
mutation CreateOAuth2Client( | ||
$allowedCorsOrigins: [String!] | ||
$audience:[String!] | ||
$authorizationCodeGrantAccessTokenLifespan: String | ||
$authorizationCodeGrantIdTokenLifespan: String | ||
$authorizationCodeGrantRefreshTokenLifespan: String | ||
$backChannelLogoutSessionRequired: Boolean | ||
$backChannelLogoutUri: String | ||
$clientCredentialsGrantAccessTokenLifespan: String | ||
$clientName: String | ||
$clientSecret: String | ||
$ClientSecretExpiresAt: Int | ||
$clientUri: String | ||
$contacts: [String!] | ||
$frontchannelLogoutSessionRequired: Boolean | ||
$frontchannelLogoutUri: String | ||
$grantTypes: [String!] | ||
$implicitGrantAccessTokenLifespan: String | ||
$implicitGrantIdTokenLifespan: String | ||
$jwks: Map | ||
$jwksUri: String | ||
$jwtBearerGrantAccessTokenLifespan: String | ||
$logoUri: String | ||
$metadata: Map | ||
$policyUri: String | ||
$postLogoutRedirectUris: [String!] | ||
$redirectUris: [String!] | ||
$responseTypes: [String!] | ||
$scope: String | ||
$sectorIdentifierUri: String | ||
$subjectType: String | ||
$tokenEndpointAuthMethod: String | ||
$tokenEndpointAuthSigningAlgorithm: String | ||
$tosUri: String | ||
$userinfoSignedResponseAlgorithm: String | ||
$loginBindings: LoginBindingsInput | ||
) { | ||
createOAuth2Client( | ||
allowedCorsOrigins: $allowedCorsOrigins | ||
audience: $audience | ||
authorizationCodeGrantAccessTokenLifespan: $authorizationCodeGrantAccessTokenLifespan | ||
authorizationCodeGrantIdTokenLifespan: $authorizationCodeGrantIdTokenLifespan | ||
authorizationCodeGrantRefreshTokenLifespan: $authorizationCodeGrantRefreshTokenLifespan | ||
backChannelLogoutSessionRequired: $backChannelLogoutSessionRequired | ||
backChannelLogoutUri: $backChannelLogoutUri | ||
clientCredentialsGrantAccessTokenLifespan: $clientCredentialsGrantAccessTokenLifespan | ||
clientName: $clientName | ||
clientSecret: $clientSecret | ||
ClientSecretExpiresAt: $ClientSecretExpiresAt | ||
clientUri: $clientUri | ||
contacts: $contacts | ||
frontchannelLogoutSessionRequired: $frontchannelLogoutSessionRequired | ||
frontchannelLogoutUri: $frontchannelLogoutUri | ||
grantTypes: $grantTypes | ||
implicitGrantAccessTokenLifespan: $implicitGrantAccessTokenLifespan | ||
implicitGrantIdTokenLifespan: $implicitGrantIdTokenLifespan | ||
jwks: $jwks | ||
jwksUri: $jwksUri | ||
jwtBearerGrantAccessTokenLifespan: $jwtBearerGrantAccessTokenLifespan | ||
logoUri: $logoUri | ||
metadata: $metadata | ||
policyUri: $policyUri | ||
postLogoutRedirectUris: $postLogoutRedirectUris | ||
redirectUris: $redirectUris | ||
responseTypes: $responseTypes | ||
scope: $scope | ||
sectorIdentifierUri: $sectorIdentifierUri | ||
subjectType: $subjectType | ||
tokenEndpointAuthMethod: $tokenEndpointAuthMethod | ||
tokenEndpointAuthSigningAlgorithm: $tokenEndpointAuthSigningAlgorithm | ||
tosUri: $tosUri | ||
userinfoSignedResponseAlgorithm: $userinfoSignedResponseAlgorithm | ||
loginBindings: $loginBindings | ||
) { | ||
...OAuth2ClientFragment | ||
} | ||
} | ||
|
||
fragment OAuth2ClientFragment on OAuth2Client { | ||
allowedCorsOrigins | ||
audience | ||
authorizationCodeGrantAccessTokenLifespan | ||
authorizationCodeGrantIdTokenLifespan | ||
authorizationCodeGrantRefreshTokenLifespan | ||
backChannelLogoutUri | ||
clientCredentialsGrantAccessTokenLifespan | ||
clientId | ||
clientName | ||
clientSecret | ||
ClientSecretExpiresAt | ||
clientUri | ||
contacts | ||
createdAt | ||
frontchannelLogoutSessionRequired | ||
frontchannelLogoutUri | ||
grantTypes | ||
implicitGrantAccessTokenLifespan | ||
implicitGrantIdTokenLifespan | ||
jwks | ||
jwksUri | ||
jwtBearerGrantAccessTokenLifespan | ||
logoUri | ||
metadata | ||
owner | ||
policyUri | ||
postLogoutRedirectUris | ||
redirectUris | ||
responseTypes | ||
scope | ||
sectorIdentifierUri | ||
subjectType | ||
tokenEndpointAuthMethod | ||
tokenEndpointAuthSigningAlgorithm | ||
tosUri | ||
updatedAt | ||
userinfoSignedResponseAlgorithm | ||
organization{ | ||
name | ||
} | ||
loginBindings{ | ||
users{ | ||
id | ||
} | ||
groups{ | ||
name | ||
} | ||
} | ||
} |
Oops, something went wrong.