concept context in category security

This is an excerpt from Manning's book API Security in Action.
It is important to remember that there is no such thing as a perfectly secure system, and there is not even a single definition of “security.” For a healthcare provider, being able to discover whether your friends have accounts on a system would be considered a major security flaw and a privacy violation. However, for a social network the same capability is an essential feature. Security therefore depends on the context. There are many aspects that should be considered when designing a secure API, including the following:
Figure 8.3 In an ABAC system access control decisions are made dynamically based on attributes describing the subject, resource, action, and environment or context of the API request.
![]()
Listing 13.8 Deriving the sender and recipient keys
private static Key deriveKey(Key hkdfKey, byte[] id, byte[] idContext, AlgorithmID coseAlgorithm) throws GeneralSecurityException { int keySizeBytes = coseAlgorithm.getKeySize() / 8; CBORObject context = CBORObject.NewArray(); #A context.Add(id); #A context.Add(idContext); #A context.Add(coseAlgorithm.AsCBOR()); #A context.Add(CBORObject.FromObject("Key")); #A context.Add(keySizeBytes); #A return HKDF.expand(hkdfKey, context.EncodeToBytes(), #B keySizeBytes, "AES"); #B }#A The context is a CBOR array containing the ID, ID context, algorithm identifier, and key size.

This is an excerpt from Manning's book API Security Starter.
It is important to remember that there is no such thing as a perfectly secure system, and there is not even a single definition of “security.” For a healthcare provider, being able to discover whether your friends have accounts on a system would be considered a major security flaw and a privacy violation. However, for a social network the same capability is an essential feature. Security therefore depends on the context. There are many aspects that should be considered when designing a secure API, including the following:

This is an excerpt from Manning's book Secure by Design.
Let’s go back to the example of the
Userclass from the previous section and see how you’d approach it instead by focusing on good design. First, you’ll discuss with your domain experts what the meaning of a username is in the context of the current application (figure 1.4).
DDD isn’t a silver bullet; its value depends on the context. There are situations where a main focus on modeling the domain isn’t the right choice. For example, if you write software for a network router, then I/O throughput will be the most critical thing. Your critical complexity is technical in this case. But even here, you should consider whether a sloppy domain model might be a security issue.