Atom

Atom In Simple Words

A plain-language explanation of what Atom is and how it works.

Atom is one place that knows:

  • who exists;
  • how they prove who they are;
  • what they are allowed to do.

In Magistrala terms, Atom is the security brain behind domains, users, clients, channels, roles, credentials, and certificates.

The Short Version

Think of a factory gate.

  1. The gate has a list of known people, devices, and services.
  2. Each one has a way to prove its identity, such as a password, API key, or certificate.
  3. The gate has rules that say what each one may do.
  4. Every time someone tries to enter or use something, the gate checks the live rules.

That gate is Atom.

Atom does not just create users. It also answers runtime questions such as:

Can device meter-001 publish to channel telemetry?
Can Alice manage this tenant?
Can this certificate still identify this client?

Glossary

Atom termSimple meaningMagistrala example
TenantTop boundary for a customer, domain, or workspaceDomain factory-a
EntityAnything that can log in or receive accessUser alice, device meter-001, service fluxmq-auth
ResourceSomething protected by access rulesChannel telemetry, rule temperature-alert
CredentialA way an entity proves who it isPassword, API key, certificate
ActionOne operation someone wants to doread, publish, subscribe, manage
Action ApplicabilityWhether an action makes sense for a kind of objectpublish is valid for channels
Permission BlockThe actual access rule: where, what actions, allow or denyChannels in Plant-A can be published to
RoleA friendly name for a set of permission blocksPlant-A Publisher
Role AssignmentGives a role to an entity or groupGive Plant-A Publisher to meter-001
Direct PolicyGives one permission block directly without a roleAllow one service to publish to one channel
Principal GroupA group of identities that should receive the same roleField devices
Object GroupA group of protected objects that access applies toPlant-A clients and channels
Audit LogHistory of important security eventsLogin failed, credential created, access denied

Login Flow

What this means: a user, device, or service proves its identity with a secret. Atom checks that secret against the database. If it is valid and the entity is active, Atom returns an authenticated session or runtime authentication result.

Authorization In One Sentence

Authorization means Atom answers this question:

Can this subject perform this action on this object right now?

For example:

Can meter-001 publish to telemetry?

Atom checks roles, direct policies, principal groups, object groups, deny rules, and optional conditions. Tokens do not carry permissions. The decision is checked live, so changes take effect immediately.

Action Applicability is only a validity check. It can say "publish is a valid action for channels," but it does not give anyone permission. A role assignment or direct policy must still point to a permission block that grants the action.

Certificates In One Sentence

Certificates are another kind of credential.

Atom can issue a certificate for an entity, store the issued certificate as a credential row, and later resolve that certificate back to the entity during mTLS runtime traffic.

The CA private key is not stored in Postgres. The platform operator mounts CA files into Atom.

How Magistrala Uses Atom

Magistrala uses Atom's generic objects:

MagistralaAtom
DomainTenant
UserEntity with kind = human
ClientEntity with kind = device or service
ChannelResource with kind = channel
Client keyPassword credential or API key credential
Client certificateCertificate credential
Client-channel accessRole assignment or direct policy

Runtime services such as FluxMQ ask Atom whether a client is authenticated and whether it can publish or subscribe. Atom returns the decision; Magistrala keeps handling messages, storage, and application behavior.

What Atom Does Not Do

Atom does not store telemetry messages, run device protocols, or replace application logic. It owns identity, credentials, access decisions, certificates, and audit history.

That split keeps security centralized while letting applications stay focused on their own domain.

On this page