Secrets in dependencies

There must be an easier way to explain this, but …

I have a main app (MA) with several smaller dependency apps (DA).
I duplicate the secrets’ names from the MA into the DAs to allow the DAs to be developed independently.
When I import the DA into the MA, the get_secrets() in the DAs now refer to the secrets in the MA (if they exist).

Can I rely on this behaviour?

It works for me because I don’t have to worry about the test data in the secrets in the DAs being used in the MA.

Yes, that is the official correct behaviour. get_secret() looks up in the main app first, then falls back to dependencies if there’s no secret of that name in the main app.

4 Likes