Spartacus front-end logging system? - spartacus-storefront

I would like to setup logging system on Spartacus storefront.
Does Spartacus has any default logging system?
For example: Graylog?
For example I have timer for some action, and if timer expired, I want to log it to the graylog. Timer in some Angular Service.

We forked https://github.com/dbfannin/ngx-logger and added an OCC endpoint which the logger can submit logs to. The OCC endpoint logs to a logger that is dedicated to the frontend.

Related

Sending xAPI statement to a web application instead of LRS

I have an xAPI content made by storyline I want for the statement to be sent to a webapp instead of the LRS.
this webapp is developped using laravel, and user should be authenticated with email and password to use it.
what I did to send the statement to this app:
1.in the webapp I created an API endpoint route that use POST method.
2.in the xAPI wrapper I changed the endpoint in the configuration to the route I made in the webapp.
const conf = {
"endpoint":"here I added my api endpoint route of the webapp",
"auth":"Basic " + toBase64(""),
}
now whith any interaction with the content where a statement should be sent the request making cors error like in the picture down, I think this is authentication error, how can I add my authentication credentials to the xAPI wrapper?
Your non-LRS LRS is probably not handling preflight requests which are necessary for CORS handling. Most common LRSs will handle those requests appropriately since they expect to be accessed from additional origins. See https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#preflighted_requests
Also note that you'll likely run into issues unless you also handle state requests.
Additionally unless you are requesting the credentials from the user during runtime then hard coding the credentials into the package isn't a great idea from a security perspective.

"Service worker" and notifications when the POST request is cached

I have create a PWA with VueJS and the plugin workbox.
The user can navigate in the application if is offline with the service worker cache.
I cache the request POST and PATCH if the user is offline, but I would like notify the user in this case.
If I use import or require the service worker sends a error message so I cannot use the VueX store to display a message.
Anyone have an idea to solve this problem?

virto commerce deployement from Github

I have successfully deployed the virto platform and storefront on to azure.
the CMS content connection string was taken from the platform appsettings and assigned to the storefront CMS connection setting. The Api Hmac App Id and secret keys are assigned as per the documentation.
Platform and storefront are synced in azure with the latest.
however, when the storefront url is entered in the browser, it does not show the storefront, insted the following error occurs.
This page isn’t working our storename.azurewebsites.net is currently unable to handle this request.
HTTP ERROR 500
please advise if anyone encountered such error. Did I miss any other settings?
First of all, that is NOT CMS connection string related issue.
Second, try these:
restart platform app service
restart storefront app service
clear browser cookies / open page in anonymous mode. The url should start with https, not http
wait for 30 seconds as this could be a timeout issue on slower service configurations
Third: set ASPNETCORE_ENVIRONMENT=Development as described in https://learn.microsoft.com/en-us/aspnet/core/fundamentals/environments?view=aspnetcore-2.2#set-the-environment to get error stacktrace

How to auto-enabled Kong authentication plugin for new APIs?

We are using Kong in our custom-services deployment system and we developed a new authentication plugin for Kong to suit our specific need.
All of this works well and we tested it doing this:
Register a new API (service)
Make a POST request to enabled the authentication plugin on the new API
While this works, it opens a window of opportunity for hackers to perform unauthenticated requests between 1. and 2. This is not acceptable obviously but I could not find a way to auto-enable the authentication proxy automatically.
Is there a way in Kong to either:
Auto-enable a given set of plugins for all new APIs.
Specify the list of plugins to enable when registering a new API.
Currently there is no way to automatically apply a plugin policy to an API at insertion time. There is another issue that could also help (but currently not implemented): https://github.com/Mashape/kong/issues/1279
Which would allow you to:
Add API, but enabled=false and no requests can be proxied to it.
Add plugins
Enable the API with enabled=true.
As of today, the only way would be:
Add an API with a fake upstream_url that goes nowhere.
Add plugins.
Update the API with a PATCH request to now point it to a correct upstream_url.

Different serverTokenEndpoint for login and registration

I'm using ember-simple-auth for logging in a user which is working fine. For logging a user in, I've to ping this endpoint: /auth/sign_in.
However, for registering a new user, I've to ping a different endpoint: /auth.
If I'm trying to use the ember-simple-auth for also registering (as instructed in this blog: http://www.thegreatcodeadventure.com/building-user-registration-with-ember-simple-auth/), I'm facing the issue that Ember is pinging the same endpoint (as specified in the serverTokenEndpoint).
How can I register a new user using ember-simple-auth?
User creation on signup goes through the Ember Data adapter, not the Ember Simple Auth authenticator so it won't use the serverTokenEndpoint you configure for the authenticator but the host/namespace you configured for the adapter.