|
| 1 | +package com.gigya.auth; |
| 2 | + |
| 3 | +import com.gigya.socialize.GSObject; |
| 4 | +import com.gigya.socialize.GSRequest; |
| 5 | + |
| 6 | +public class GSAnonymousRequest extends GSRequest { |
| 7 | + |
| 8 | + /** |
| 9 | + * @param apiKey Site api key. |
| 10 | + * @param apiDomain Site api domain. |
| 11 | + * @param apiMethod Request api method. |
| 12 | + */ |
| 13 | + public GSAnonymousRequest(String apiKey, String apiDomain, String apiMethod) { |
| 14 | + super(apiKey, null, null, apiMethod, null, true, null); |
| 15 | + setAPIDomain(apiDomain); |
| 16 | + } |
| 17 | + |
| 18 | + /** |
| 19 | + * @param apiKey Site api key. |
| 20 | + * @param apiDomain Site api domain. |
| 21 | + * @param clientParams Request parameters. |
| 22 | + * @param apiMethod Request api method. |
| 23 | + */ |
| 24 | + public GSAnonymousRequest(String apiKey, String apiDomain, GSObject clientParams, String apiMethod) { |
| 25 | + super(apiKey, null, null, apiMethod, clientParams, true, null); |
| 26 | + setAPIDomain(apiDomain); |
| 27 | + } |
| 28 | + |
| 29 | + @Override |
| 30 | + protected void signRequest(String token, String secret, String httpMethod, String resourceURI) { |
| 31 | + // Override super call. |
| 32 | + if (this.apiKey != null) { |
| 33 | + setParam("apiKey", this.apiKey); |
| 34 | + } |
| 35 | + } |
| 36 | + |
| 37 | + @Override |
| 38 | + protected boolean evaluateRequestAuthorization() { |
| 39 | + return this.apiKey != null; |
| 40 | + } |
| 41 | +} |
0 commit comments