Mule4.xx Applying Offline Custom Policies - mule4

Has somebody managed to deploy a custom policy via offline Applying Offline Custom Policies
Any additional tricks besides the documentation mentioned in the link above?
We want to apply mule4 custom policy without going through the any point platform but rather from the manual deploy on mule runtime as described in the document which states "If you do not want to use the policy template from... "

Related

Not using AdSupport with Firebase

I am working on a project which doesn't allow us to use the AdSupport Framework. We are wondering what data we will lose / won't have access to with Firebase because of that.
The official documentation only states that "Some Analytics features, such as audiences and campaign attribution, and some user properties, such as Age and Interests, require the AdSupport framework to be enabled. Without this framework, Analytics cannot collect information needed for these features to function properly."
I can't find any additional details anywhere (including here).
I would appreciate the feedback from experts who faced the same situation.
Thanks a lot!

Persist Firebase Auth session in Google Workspace Add-on

I'm working on a Google Sheets add-on that needs to interact with existing web-app. The app uses Firebase for authentication. Firebase is not available as an "Advanced Google Service" and there is no official library (as well as official docs advice against using libraries in an add-on), so I'm using #firebase/auth in the client-side code.
The code is simple and the same as I'm using in the web-app (without FirebaseUI, but I've tried it as well) and because add-ons cannot use cookies or localStorage*, the Firebase cannot persist a local session.
Within the add-on we can only use Google Script Properties service, so I'm looking if there is a way to persist a session manually for the Firebase (like provide own "Storage" implementation, I've just done this for another node package I use in the add-on).
The question is mostly about Firebase and environment with no cookies/localStorage but other storage, but I may be missing some other way to use Firebase Auth with script add-ons.
Thanks for you help.
Edited: removed indexedDB, I've checked it in Console and accidentally switched from iframe to the top context, of course indexedDB is also unavailable in iframe (we should be sure the add-on works in Chrome).
* yes, we can ask user to go to the Chrome settings and select "Allow all cookies" but this is not an option for production.
I don't think there's any documented way to control the storage that Firebase Authentication beyond the picking from the options mentioned in the documentation on auth state persistence.
I think allowing you to provide a custom storage implementation would be a valid feature request, so I recommend asking for it here. I don't think the request comes up frequently though, so it may not get the priority you'd like. In that case: implementing the feature would require allowing the developer to specify their own storage in the public SDK, and then you in your project implementing your own storage provider similar to the storage providers in the SDK.

How to autofill support email in the GCP project

I’m creating the GCP project using this method https://cloud.google.com/resource-manager/reference/rest/v1/projects/create. As I understand this method doesn’t allow fill the Support email for the project.
Please, advise me, what other options are there to fill the support email automatically through the API?
The answer here is that currently the creation or submission of the email address for support portal use is not supported using the projects.create methods of the API... The full list of all methods for the API are listed in this documentation1.You can always file a feature by following the instructions contained here2

How to create custom JSON-API resource drupal 8

I have issues with creating custom JSON API resource which will be visible on mydrupalsite/jsonapi link.
I have found this example:
https://glamanate.com/blog/using-json-api-query-your-search-api-indexes
which shows how to create custom resource but it is outdated. I tried to make a custom module looking in this article, but it doesn't work anymore because json-api module has changed.
For example, I want to show all nodes and make the jsonapi endpoint of type nodes--all which will serve all the nodes of my Drupal site.
I am using drupal 8.7.1 and JSON API core module.
I have tried to google this problem, but there are no examples for creating custom json api endpoints.
For final result i want to make jsonapi endpoint for example: mydrupalsite/jsonapi/nodes/all which will serve all nodes.
You could declare REST endpoints within a custom module.
In /modules/custom/mymodule/src/Plugin/rest/resrouce/MyEndPoints.php, create a class extending ResourceBase, according to https://www.drupal.org/docs/8/api/restful-web-services-api/custom-rest-resources.
Then you could define which set of nodes you want to expose, use query parameters to filter them, paginate, or do whatever you want.
See also : https://medium.com/#emerico/create-custom-rest-resource-for-get-and-post-method-in-drupal-8-e445330be3ff
I successfully used this technique to get events displayed with FullCalendar library, I can elaborate on this if it helps.
Good luck with it
The module does not currently support external connection to its internal-use-only API according to the JSON:API's module maintainers, hence why your referenced module does not work anymore.
There are plans for the mixed bundle you are requesting. See the thread below for the discussion.
https://www.drupal.org/project/jsonapi_extras/issues/2956414
Checkout JSON:API Cross Bundles
We discussed this in Decoupled Days 2019. We came to the following
conclussions:
We will put this under a different contrib as per my request ☺️ jsonapi_cross_bundles
There will only be support for GET
The edge cases in filtering will be solved using whatever stance Entity Query API uses.
In parallel we'll create a JSON:API issue to add a payload to the 404 routes like /jsonapi/node that will contain: (a) a list of links
to the resource types for that entity type, and (b) link to a
documentation page explaining the cross bundle situation (maybe even
mentioning the experimental jsonapi_cross_bundles module).
Source: https://www.drupal.org/project/jsonapi_extras/issues/2956414#comment-13189872
As of 2021, the best way to do this is the JSON:API Resources module.
This module allows you to add your own JSON:API endpoints in a custom module.
There are several examples of how to define your own resources.

Fine grained access control with Appsync/Firebase

Will it be a good idea to create a completely "serverless" app using Appsync/Firebase when fine-grained access control is necessary?
I tried to build an app with Firebase, and then with AppSync and it feels like these solutions are kind of crippling me, and I started to think that maybe im still thinking in the "old" way of solving the problem, and that's what is crippling me and not the tools.
Where im struggling is with access control.
Firebase has "Firebase rules" and AppSync has "VTL"(Apache Velocity Template Language), both offer relatively good solutions, "Firebase rules" is easier and cleaner, but VTL is more robust because it is basically a programing language.
The problem is that im trying to give the user access to documents on the database based on a "collection/table" of permissions. So each user has a document inside that "collection/table" with fine-grained permissions, and I need to read that document in order to know if he has access to the resource he is trying to read/write.
With both, firebase and AppSync I can read the DB, but both have their limits:
Firebase Rules has request limits. and that is problematic if a user
has multiple "permission groups".
AppSync is more flexible, but still limited, and I rather use my language of choice rather than VTL if im going to write some logic. And in addition, I rather have that code inside my project locally than only in the cloud accessible via the GUI.
So, in the end, it feels like both solutions drive me into having another layer before them in order to do more complex stuff, so it can either be functions or an entire app.
But then, why do I need all of their APIs? Having another layer before Appsync/Firebase basically forces me to reimplement GraphQL/Firebases API, and then, why not build it using another tool?
So, am I doing it all wrong? Will it be better to have an app deployed on AppEngine or a similar solution(and thus losing the advantages of functions)?
Note: Im sorry if after all this reading its still not clear, English is my first language.
AWS AppSync added Pipeline Resolvers recently, which sounds like a perfect solution for your use case. You compose the GraphQL resolver with a chain of Resolver Functions. Your auth check against the document collection table can be implemented as a reusable function.
Take a look at the Pipeline Resolvers tutorial to see if it meets your needs.

Resources