Italiano

4. API keys

Level: integration. How to generate the key the apps read their configuration with, what it decides, how to find it again and how to revoke it. The previous page is Members and roles, the next one is Audit log.

The API keys page is seen by the Editor, the Admin and the Owner. For the others the message is “You need to be an editor, admin or owner of this tenant to manage its API keys.”

At the top of the page, under the title, the Use the key with an SDK link leads to the SDK page, with the line that installs the SDK in the app that will use the key (page 1). The link is there for every role.

What a key is, exactly

An API key is the credential an app — not a person — asks for its configuration with. It belongs to one environment only, and from it Squiddy understands where the request comes from:

Where it comes fromWhat it carries
The API keyOrganization, project and environment
The app, on every requestIts appId and its context (version, platform, language…)

With both, Squiddy answers with the right configuration for that app.

The only coordinate the app declares is the appId: organization, project and environment come from the key. Three practical consequences follow:

Generating a key

Press Generate key and fill in three fields, one after the other:

FieldNotes
ProjectOnly used to reach the environment
EnvironmentPicked after the project: it is the environment the key will give access to
NameA name for you (for example CI pipeline, iOS production app): it is what you will read in the list when you have to decide whether to revoke it

Press Generate key again: the API key created box appears in the window, with the whole key and this notice:

Copy CI pipeline now and keep it somewhere safe. If you lose it, the API keys list can show it again.

(with the name you gave the key).

Squiddy keeps the key encrypted. Whoever can manage the organization's keys can have it shown again from the list (see below), and every time a trace is left in the audit log as key shown. Keys created before Squiddy started keeping them encrypted can no longer be read again, by anyone: if you have lost one, generate another and revoke the old one.

Where to keep it. In the secrets manager of whoever builds the app, never in the source code. A distributed app, though, carries it inside the installed package, and anyone who has the app can extract it: a key inside an app is not a secret. It only allows reading the environment's published configurations — for whatever appId, platform, mode or parameter whoever uses it chooses to send — and using up the key's request limit, which depends on the plan (page 1). It gives no access to the dashboard and does not allow changing anything. Two rules follow: put nothing in the configurations that you would not show to whoever uses the app, and think about which environment the key serves and how much it would cost to replace it (below). The SDK guide, on the documentation site, explains this to whoever connects the app.

In the dashboard the service the apps read their configuration from is also called the data plane: it is what the key gives access to.

The list

ColumnContent
NameThe name you chose (it can be changed)
KeyThe start of the key, not the whole key: it is there to recognize it in the list without showing it. For an active key, next to it, Show and Copy (below)
EnvironmentThe environment it gives access to
CreatedWhen it was generated
Last usedThe last time a request used it, or Never. It can lag a few minutes behind, and it is not an access log: it is there to answer the question “is anyone still using this key?”
StatusActive or Revoked

Above the list you can search for a key by name. Renaming a key changes only the name: the key and what it allows stay the same.

Seeing or copying a key again

Next to the start of every active key there are two commands:

The first time you use either of them, Squiddy hands you the key and writes in the audit log who asked for it (key shown, with the name and the start of the key, never the whole key). As long as you stay on the page, the following commands do not ask for it again.

A revoked key does not have these commands: a key that no longer works is not shown. Neither does a key created before Squiddy kept keys encrypted, and in their place it says: “Can't be shown again: created before keys were stored. Generate a new one if you need it.”

Revoking

From the row's menu → Revoke, with the confirmation:

Revoke CI pipeline? Any client using it loses access immediately. This cannot be undone.

(with the name of the key). Both statements are to be taken literally:

To replace a key, follow this order: generate the new one, put it in the apps and check that the apps use it, and only then revoke the old one. The Last used column tells you whether anyone still uses the old one.

When the apps do not receive the configuration

Three different causes that look alike from the outside, and how to tell them apart:

SymptomLikely causeCheck
Credential refusedWrong key, or revokedThe Status in the list; is the start of the key the one of the key you put in the apps?
Configuration not foundThe appId has no configuration in that environment, or the key points to another environmentOpen the Configurations page of the key's environment and look for the appId
Access blocked for the accountThe organization is suspended with serving blockedThe suspension screen says so when you enter the dashboard (page 1)

The third case differs from the first on purpose: whoever connects the app must understand that the problem is not the key, and not waste time replacing it.

If instead the configuration arrives but is not the one you expect, the problem is not the key (unless it points to the wrong environment): it is the way the configuration picks the answer, and you find it out with the Tester of the Configurations page (Configurations).