Google Endpoints API + Chrome Extension returns None for endpoints.get_current_user().user_id()
By : K9 PrivaTex
Date : March 29 2020, 07:55 AM
Hope this helps It's unclear why/when this ever results in a 200; it should not. As mentioned in Function User.getUserId() in Cloud endpoint api returns null for a user object that is not null, this is a known issue. TLDR; code :
oauth.get_current_user(some_scope)
oauth.oauth_api._maybe_call_get_oauth_user(_scope=None)
endpoints_user = endpoints.get_current_user()
if endpoints_user is None:
raise endpoints.UnauthorizedException(...)
oauth_user = oauth.get_current_user(known_scope)
if oauth_user is None or oauth_user.user_id() is None:
# This should never happen
raise endpoints.NotFoundException(...)
|
Google Cloud Endpoints in Android Studio: how to generate Endpoints class in a different package
By : bhavin patel
Date : March 29 2020, 07:55 AM
should help you out This is a good question. Currently there is no way to specify that but there should be. In the meantime you can simply move the generated endpoint to your desired package after generation.
|
AngularJS + Cloud Endpoints: loading endpoints api across multiple controllers
By : Yireh Enterprises
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , A better approach to this would be to leverage the power of Promises. you can then have your Service init once (inside the service function) and on every method you simply call promise.then(...) and keep the logic specific to this method. take this as an example: code :
app.factory('cloudendpoints', ['$q','$timeout','$window',function cloudendpoints($q,$timeout,$window) {
var backend_ready = $q.defer();
checkLoaded();
function checkLoaded(){
if($window.gapi)
backend_ready.resolve();
else
$timeout(checkLoaded,100); //check again in 100ms
}
var init = function(postInit) {
var restUrl = '//' + window.location.host + '/_ah/api';
return backend_ready.promise.then(function(resp){
gapi.client.load('cloudendpoints', 'v1', postInit, restUrl);
}); //we are returning a promise so we can have more
//flexability inside the controllers (do stuff after the loaded api);
};
return {
init: init
};
}]);
//Somewhere inside a controller...
app.controller('someCtrl', ['cloudendpoints', function(cloudendpoints){
function postInit(){ ... }
cloudendpoints.init(postInit); //waits for gapi to load, then executes init
});
|
cannot query kubernetes (unauthorized): endpoints is forbidden: User cannot list endpoints in the namespace
By : Zhixing Zhang
Date : March 29 2020, 07:55 AM
I wish did fix the issue. The default service account for the staging namespace (in which apparently your Pods using libcluster are running) lacks RBAC permissions to get endpoints in that namespace. Likely your application requires a number of other permissions (that are not mentioned in the above error message) to work correctly; identifying all such permissions is out of scope for SO. code :
$ kubectl create clusterrolebinding make-staging-sa-cluster-admin \
--serviceaccount=staging:default \
--clusterrole=cluster-admin
clusterrolebinding "make-staging-sa-cluster-admin" created
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: some-permissions
namespace: staging
rules:
- apiGroups: [""]
resources: ["endpoints"]
verbs: ["get", "list", "watch"]
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: give-default-sa-some-permissions
namespace: staging
subjects:
- kind: ServiceAccount
name: default
namespace: staging
roleRef:
kind: Role
name: some-permissions
apiGroup: rbac.authorization.k8s.io
|
Apache Camel mockEndpoints() mocks all endpoints, instead of endpoints in advised route only
By : bit_10
Date : March 29 2020, 07:55 AM
help you fix your problem The javadoc is a bit mistaken, it is really mocking all endpoints for all routes. You can only auto-mock by using filters, wildcards etc. We will update the javadoc for future Camel versions. What is the specific reason you want to limit to endpoints in the route only. An endpoint can be shared among other routes etc, such as when you link routes together etc. Also mocking other endpoints for testing will not affect these endpoints.
|