I want to create a very simple script
function myFunction() {
var group = AdminGroupsSettings.newGroups();
Logger.log(group)
}
But I have the error ReferenceError: AdminGroupsSettings is not defined.
However, my Admin SDK is well added from Services.
The function is a simple copy from the Update a group's settings example
The Groups Setting API seems to be different from the Admin SDK API.
I recommend using the Admin SDK API instead of the Groups Setting API.
Related
For example, I have https://REGION-FUNCTIONS_PROJECT_ID.cloudfunctions.net/myfunctionname
But I want to have a root link to my function. Something like that:
https://myfunctionname.REGION-FUNCTIONS_PROJECT_ID.cloudfunctions.net/
How can I get this?
You can't change the URL provided by Cloud Functions, but you can use Firebase Hosting as a proxy to Cloud Functions so you can use a custom domain to access functions deployed to the same project.
https://firebase.google.com/docs/hosting/functions
Currently there is no way to get a different URL from a Cloud Function other than the one automatically generated which will always have the format "https://REGION-PROJECT_ID.cloudfunctions.net/hello_get".
If there was a way to do this, it would need to be defined during ht deployment of the function, and according to the documentation for 'gcloud function deploy', there is no way to specify a way to change the URL generated.
I am designing an API using WSO2AM 2.0
My service is like : http://190.100.10.10:9000/abc/xyz/doPost<br>
I want to replace /abc/xyz/doPost by /<MY_CUSTOM_PATH>/doPost
How can I make a custom URL pattern to hide my original URL path from the service?
Like: http://<WSO2AM_GENERATED_HOST>/WSO2AM_CONTEXT/WSO2AM_VERSION/<MY_CUSTOM_PATH>/doPost
I have searched the docs, but I am not able to find any related tutorial.
If I put /abc/xyz/doPost it will get appended to the WSO2AM generated hostname.
What is "EDIT SOURCE" in the image below? Can it be used to do what I want? If YES, How??
There aren't anything like WSO2AM_CONTEXT or WSO2AM_VERSION. You can provide any value for the context and version. Version can be String, numbers, etc.
In your case, you can use abc as context and xyz as the version.
That is exactly the kind of URL you would get in WSO2 API Cloud: http://your.custom.url/api-name/version/context. See this tutorial for details: https://docs.wso2.com/display/APICloud/Customize+the+API+Store+and+Gateway+URLs
It might not be complicated...
In publisher interface, when you add/edit an API, in "Implementation" screen, just configure WSO2 APIM to point to "http://190.100.10.10:9000/abc/xyz" - this way, "/abc/xyz" will not be visible to your clients.
So in this case,
http://<WSO2AM_GENERATED_HOST>/WSO2AM_CONTEXT/WSO2AM_VERSION/doPost
will point to:
http://190.100.10.10:9000/abc/xyz/doPost
If you wanted to add additional custi=om paths, in the "Design" screen you attached, you can also add your "(MY_CUSTOM_PATH)/doPost" path there.
This way
http://<WSO2AM_GENERATED_HOST>/WSO2AM_CONTEXT/WSO2AM_VERSION/<MY_CUSTOM_PATH>/doPost
will point to:
http://190.100.10.10:9000/abc/xyz//<MY_CUSTOM_PATH>/doPost
(However, your backend services should also have "//doPost" implemented)
I have a Rails app developed using the Spree gem. For security reasons, I'd like to disable all the API functionality - ability to make REST calls, the methods, routes. I realize that most of the API functionality cannot be invoked without an API token.
What's the best way to 'turn off' the API features?
Best way == least intrusive to existing code base
The best I've come up with so far is adding this to my host application's application.rb inside the Application class:
initializer "delete_spree_api_routes", after: "add_routing_paths" do |app|
app.routes_reloader.paths.delete_if { |path| path =~ /\/spree(-[^\/]+)?\/api\/config\/routes.rb/ }
end
What this does is immediately deletes all of the paths from the routes if they were loaded from routes.rb provided by the Spree API. It's a bit ugly but it does the job.
EDIT: I'd recommend being careful with this as Spree uses its own API in a few cases such as retrieving the list of states for a country (GET /api/v1/states)
I have a single web2py app which I have set up to be the default by using
routers = dict(
BASE=dict(
default_application='myapp',
),
)
As recommended in the docs. I want to remove the admin app, but retain the ability to administer by app using my app/appadmin. Is this possible? I tried simply removing the app, but now when I go to https://example.com/appadmin, I get redirected to https://example.com/admin?send=%2Fappadmin and this replies (quite reasonably) with "invalid controller (default/index)".
The appadmin.py controller delegates authentication to the admin app, so you cannot access appadmin without the admin app. The only exception is that you can access the /appadmin/manage functionality described here, as that is authenticated via the application itself.
Alternatively, you can hack your application's appadmin.py controller to change how authentication is managed -- see here.
A sitecore newbie here. We have an existing website that's built using Sitecore 8. It's live in our production environment. I recently joined the company and my background is backend .NET development. I have been asked to write a utility module that allows us to remove registered users that meet certain criteria. The website provides the ability for users to register and the registered users are stored in the core database. My initial thought was to go directly against the DB but quickly learned that the data stored is serialized. I also thought about writing a c# console application to do this but it appears that there are a lot of configuration/setup steps to do this and that it's better to do it from a web app. Does anyone have any tips on how I could set up a simple utility web application to connect to an existing Sitecore database? I expect that I will be asked to add more functions/features down the road.
For an admin function like that, I would be tempted to use Sitecore Powershell Extensions: https://marketplace.sitecore.net/en/Modules/Sitecore_PowerShell_console.aspx
The Get-User command can pull users out of the system:
Get-User Documentation
PS master:\> Get-User -Filter "michaellwest#*.com"
Name Domain IsAdministrator IsAuthenticated
---- ------ --------------- ---------------
sitecore\michael sitecore False False
Then you can use Remove-User to delete them: Remove-User Documentation
There are a lot of great resources on how to use SPE, its awesome for stuff like this.
As i understood, the objective is to be able to remove certain users.
The easiest way to do that would be using Sitecore PowerShell module, but for you as a newbie that would not be probably as easy (and you would need to have module installed). With PowerShell module you don't even need to create user interface.
Here is the documentation how to do use Remove-User with PowerShell
If PowerShell option does not work for you, you can use that from the code utilising Sitecore API, so your Delete method would look something like below:
public void DeleteUser(string userName)
{
try
{
Sitecore.Security.Accounts.User user = Sitecore.Security.Accounts.User.FromName(userName, true);
user.Delete();
}
catch (Exception ex)
{
Sitecore.Diagnostics.Log.Error(string.Format("Error in Client.Project.Security.UserMaintenance (DeleteUser): Message: {0}; Source:{1}", ex.Message, ex.Source), this);
}
}
So you would just call this method when iterating usernames to be deleted. Depending on which credentials you would run that code, you may need to wrap it with SecurityDisabler to omit permissions check for delete operation:
using (new SecurityDisabler())
{
// you code to delete here within using block
}
Hope this helps!