I’m using wso2 api manager 4.2.0 and I need to set scopes on GraphQL operations via apis.
which api should I use?
I traied to set scope on operations via Publisher UI and use the inspect in Firefox Browser. I gut something like this:
curl 'https://apig.mydomain.com/api/am/publisher/v4/apis/9c4d72da-1360-40ff-b3b7-614609cbb18a' --compressed -X PUT -H 'Content-Type: application/json' -H 'authorization: Bearer xxxxx-xxxxxxx' -H 'Cookie: xxxxxxxxx'
with a body like:
{ "id": "9c4d72da-1360-40ff-b3b7-614609cbb18a", "name": "DataService", "description": null, "context": "/cds", "version": "v1.0", "provider": "admin", "lifeCycleStatus": "PUBLISHED", "wsdlInfo": null, "wsdlUrl": null, "responseCachingEnabled": false, "cacheTimeout": 300, "hasThumbnail": false, "isDefaultVersion": false, "isRevision": false, "revisionedApiId": null, "revisionId": 0, "enableSchemaValidation": false, "enableSubscriberVerification": false, "type": "GRAPHQL", "audience": null, "transport": [ "http", "https" ], "tags": [], "policies": [ "Unlimited" ], "apiThrottlingPolicy": null, "authorizationHeader": "Authorization", "securityScheme": [ "oauth2", "oauth_basic_auth_api_key_mandatory" ], "maxTps": null, "visibility": "RESTRICTED", "visibleRoles": [ "admin", "tester" ], "visibleTenants": [], "mediationPolicies": [], "subscriptionAvailability": "CURRENT_TENANT", "subscriptionAvailableTenants": [], "additionalProperties": [], "additionalPropertiesMap": {}, "monetization": null, "accessControl": "NONE", "accessControlRoles": [], "businessInformation": { "businessOwner": null, "businessOwnerEmail": null, "technicalOwner": null, "technicalOwnerEmail": null }, "corsConfiguration": { "corsConfigurationEnabled": false, "accessControlAllowOrigins": [ "*" ], "accessControlAllowCredentials": false, "accessControlAllowHeaders": [ "authorization", "Access-Control-Allow-Origin", "Content-Type", "SOAPAction", "apikey", "Internal-Key" ], "accessControlAllowMethods": [ "GET", "PUT", "POST", "DELETE", "PATCH", "OPTIONS" ] }, "websubSubscriptionConfiguration": { "enable": false, "secret": "", "signingAlgorithm": "SHA1", "signatureHeader": "x-hub-signature" }, "workflowStatus": null, "createdTime": "1703752688157", "lastUpdatedTime": "2024-05-12 18:01:25.313", "endpointConfig": { "endpoint_type": "http", "endpoint_security": { "sandbox": { "password": null, "tokenUrl": "", "clientId": null, "clientSecret": null, "customParameters": {}, "additionalProperties": {}, "type": "NONE", "grantType": "", "enabled": false, "uniqueIdentifier": null, "username": "" }, "production": { "password": "", "tokenUrl": "", "clientId": null, "clientSecret": null, "customParameters": {}, "additionalProperties": {}, "type": "BASIC", "grantType": "", "enabled": true, "uniqueIdentifier": null, "username": "wso2-team" } }, "production_endpoints": { "config": { "retryDelay": "", "actionDuration": "360000", "retryTimeOut": "", "suspendDuration": "", "suspendErrorCode": [], "retryErroCode": [], "factor": "", "suspendMaxDuration": "", "actionSelect": "fault" }, "url": "http://spring.dataservice.svc.prod.cluster.tech:8080/publicapi" } }, "endpointImplementationType": "ENDPOINT", "scopes": [ { "scope": { "id": null, "name": "admin", "displayName": "admin", "description": "", "bindings": [ "admin" ], "usageCount": null }, "shared": true }, { "scope": { "id": null, "name": "tester", "displayName": "tester", "description": "tester users in DATA team", "bindings": [ "tester" ], "usageCount": null }, "shared": true } ], "operations": [ { "id": "", "target": "codalStatements", "verb": "QUERY", "authType": "Application & Application User", "throttlingPolicy": "Unlimited", "scopes": [ "admin", "tester" ], "usedProductIds": [], "amznResourceName": null, "amznResourceTimeout": null, "payloadSchema": null, "uriMapping": null, "operationPolicies": { "request": [], "response": [], "fault": [] } } ], "threatProtectionPolicies": null, "categories": [], "keyManagers": [ "all" ], "serviceInfo": null, "advertiseInfo": { "advertised": false, "apiExternalProductionEndpoint": null, "apiExternalSandboxEndpoint": null, "originalDevPortalUrl": null, "apiOwner": "admin", "vendor": "WSO2" }, "gatewayVendor": "wso2", "gatewayType": "wso2/synapse", "asyncTransportProtocols": [] }
and then I redeployed the Collection but I didn’t get success.