Apr 23 22:07
@appcoder
The DA lockout occurs when too many incorrect authorization attempts have been made. The TPM enters a lockout state to prevent a dictionary attack, where an attacker attempts to guess the authorization values.

To resolve a DA lockout, you have a few options:

1. **Wait it Out**: If the TPM has a lockout recovery period set, you might simply need to wait until this period expires. The duration depends on the TPM's configuration.

2. **Reset the Lockout**: If you have administrative or physical presence access, you can reset the lockout. That often requires using the TPM owner pass
Apr 23 22:07
@appcoder You are dealing with a couple of common issues related to TPM management: handle collisions where a persistent handle is already in use, and the TPM being in a Dictionary Attack (DA) lockout state. Let's address both issues:

When a persistent handle is already in use, attempting to assign another key to the same handle will indeed fail. The best practice is to manage your handles carefully, making sure that you either:
- use unique handles for different keys, or
- clear the existing handle before reassigning it to a new key, provided that the original key is no longer needed.
Apr 23 21:15
@appcoder That is correct: when using `tpm2-tools` to create a key, the `-r` option is used to output the private portion of the key to a file. However, if your goal is to make sure the private key remains within the TPM and is never exposed outside of its secure environment, you should indeed omit this option. That approach aligns with best practices for maintaining the security integrity of keys managed by the TPM.

When you run the `tpm2_create` command and you do not specify the `-r` option, the TPM will handle the private key internally, and it will not be saved to any external file. T
Apr 23 20:17
@appcoder I have edited the answer to address your last comment/question, about private key outside of tpm.
Apr 23 20:17
@appcoder OK, I have completed the answer to address the password issue.
Apr 23 20:17
@appcoder OK, I have edited the answer to include some troubleshooting steps. (before seeing your last comment)
Apr 23 20:17
@appcoder Yes, that is correct. While tpm2-tools are used for creating and managing keys within the TPM (including creating key handles and making them persistent), you need to use the tpm2-tss-engine to interface with these TPM-stored keys via OpenSSL, especially in applications like Nginx that use OpenSSL for cryptographic operations. Is that an issue?
Apr 23 20:17
@appcoder Yes, it should be possible: I have edited the answer to include the configuration process.
Apr 23 20:17
@appcoder OK. I have edited the answer to address your comment.
Apr 23 20:17
@appcoder Sorry for the delay. I have updated the answer to address your last comment.
Apr 23 20:17
@appcoder I have edited the answer to include a more detailed example.
 
Mar 26 22:32
@JonSnow If your colleague with database access does not find any issues directly in the database (such as non-unique slugs or orphaned terms) and you are still facing the same problem, then yes, revisiting the custom count approach I initially suggested could be a viable path forward. That method bypasses some of the complexities and potential inconsistencies of WordPress's native category counting, especially in nuanced situations like yours.

That would involve directly querying the posts and then programmatically counting them according to their category assignments. It is a more manual
Mar 25 20:56
@JonSnow OK. A few suggestions:

- Check for Orphaned Terms: Sometimes, terms (categories, in your case) may not be correctly associated with their taxonomy in the database due to previous migrations or deletions. Inspecting the `wp_terms`, `wp_term_taxonomy`, and `wp_term_relationships` tables in your WordPress database can help make sure there are no discrepancies.
- Directly inspect the `slug` field in the `wp_terms` table for the categories in question to make sure they are indeed unique and there are no hidden characters that might cause issues.
Mar 25 08:01
Mar 25 06:39
@JonSnow Not sure indeed: it could be a caching issue, a plugin or theme conflict, or an unexpected behavior within WordPress's query optimization mechanisms.

- caching: If category names are part of cache keys or influence cache retrieval in any way, renaming categories might invalidate related cache entries, leading to fresh database queries and correct counts being fetched.
Clear all caches, including any caching plugins, your browser cache, and server-side caches (like Redis or Memcached, if applicable). Also, if you are using a hosting service with built-in caching, check their contro
Mar 22 17:22
@JonSnow From your description: posts in categories A and B are also in category E but are not being counted towards E's total when you expect them to. That might be because of how posts are assigned to categories and how these assignments are being counted, especially considering the "E,X" and "E,Y" vs. "A,E" and "B,E" categorization in the admin panel.

So you would need:
- Posts categorized in both parent and subcategories are counted towards the parent's total.
- All categories, including subcategories, are considered, with no posts missed in the count.
Mar 22 16:16
@JonSnow: make sure to add @VonCin your message, for me to be notified
Mar 22 16:16
@JonSnow: can you post your code in this chat session
Mar 22 16:15
@JonSnow (I meant to post your own version of your code)
Mar 22 16:15
@JonSnow Great, well done! Don't forget to post here as an answer your code.
Mar 22 16:15
@JonSnow OK. I have edited the answer to propose an alternative approach.
 
Mar 10 19:37
If your login process involves refreshing or changing the CSRF token, make sure the frontend fetches the updated CSRF token after login. Since you are using cookies to manage the CSRF token, this step might involve re-fetching the CSRF token from the cookie (using Cookies.get('csrftoken')) after the login request completes.
Mar 10 19:37
After a successful login, verify on the Django side (perhaps with debug prints or logging in your login view) that the session is indeed being created and is active. Additionally, inspect the response headers for the login request to make sure the Set-Cookie header contains the session id.
Mar 10 19:37
Is your Django project correctly configured to use session authentication. That would mean including `'rest_framework.authentication.SessionAuthentication'` in the `DEFAULT_AUTHENTICATION_CLASSES` of your Django REST Framework settings.

```python
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework.authentication.SessionAuthentication',
],
}
```
Mar 10 19:36
@Axil Do you have CORS_ALLOW_CREDENTIALS set to True in your Django settings?
Mar 10 01:48
I have to go, but I will log back in later on today
Mar 10 01:44
And then use this function to create a new Axios instance whenever you need to make a request:

```javascript
const client = createAxiosInstance();

client.post("/api/login", { email, password })
.then(response => {
console.log(response.data);
// Handle successful login
})
.catch(error => {
console.error("Login error:", error);
// Handle error
});
```
Mar 10 01:44
In a development environment where services like Django and React run in separate Docker containers or under different ports on the same host, making sure that the frontend makes requests to the correct backend service URL (including the correct port) is important.
You can adjust your Axios instance creation to explicitly set the base URL each time you create a new instance, which includes the correct host and port:

```javascript
function createAxiosInstance() {
// Replace 'backend_host' with your Django backend host (e.g., 'localhost')
Mar 10 01:31
The use of Docker containers for development or deployment does not directly influence the need for or the effectiveness of using Axios instances or interceptors in this way.
Mar 10 01:30
Axios interceptors are specifically designed to allow you to intercept requests or responses before they are handled by then or catch. Using interceptors to dynamically update headers based on the latest application state (like the current CSRF token) is precisely within their intended use case.
Mar 10 01:30
Especially in applications using CSRF tokens, where tokens must be refreshed or updated based on user state changes (e.g., login, logout) to maintain security and application functionality.
Mar 10 01:30
@Axil Also, the approach you have found to work, involving creating new Axios instances or attaching interceptors directly to specific instances, is not a "hack" in the negative sense but rather a practical solution to a common challenge in web development: managing stateful headers across changing states in a web application.
Mar 10 01:27
To make sure your CSRF token update logic applies to requests made with the `client` instance, you should attach the interceptor directly to this instance:

```javascript
// Define the client instance
const client = axios.create({
baseURL: "http://127.0.0.1:8000"
});

// Attach the interceptor to the client instance
client.interceptors.request.use(function (config) {
// Retrieve and set the CSRF token here
config.headers['X-CSRFToken'] = Cookies.get('csrftoken');
return config;
});
```

By attaching the interceptor directly to the `client` instance, you make sure every request made with thi
Mar 10 01:26
@Axil When you set up an interceptor, the interceptor is attached to the specific Axios instance (or the global Axios object) on which you call .interceptors. That means that if you define an interceptor on the global Axios object (axios.interceptors), it will not automatically apply to separate Axios instances created via axios.create() unless those instances inherit or explicitly define their own interceptors.
Mar 10 01:03
@Axil I have updated the answer to address your comment.
Mar 10 01:03
@Axil I have updated the answer to address your last comment.
Mar 10 01:03
@Axil I have edited the answer to address your comment.
Mar 10 01:03
@Axil I have edited the answer with some debugging suggestions for you to try.
 
Mar 7 20:41
"Can you suggest how I can highlight my question to a broader audience?" You have already set up a bounty, so said broader audience should be notified. After that, you can edit your question and add any other result you would have gotten from your tests. You can then try mentioning your question on Twitter/Reddit or any other social site, just in case.
Mar 5 06:11
@Ashar No, it did not work indeed.
Mar 3 16:32
All I can see is a possible side-effect of a recent GitHub incident: githubstatus.com/incidents/wcl1sw4mzg60
Mar 3 16:31
I would still check the token permissions (but you might already have done that, since you told me before it had all the permissions)
Mar 3 16:30
Sometimes, there might be a delay in GitHub Actions reflecting the state changes, especially if there is a high load on GitHub's servers. That could mean that approvals have been sent but are not immediately visible in the GitHub UI.
Mar 3 16:30
Could there be a delay?
Mar 3 16:30
The screenshot and the output text you provided suggest that the `activescott/automate-environment-deployment-approval` GitHub Action is configured to approve deployments to environments `item1`, `item3`, and `item4`, and it is identifying and attempting to approve deployments triggered by the user `mohtashims`. However, you are still facing issues with the auto-approval not functioning as expected.

Given the output text, the Action seems to be functioning correctly in the sense that it is recognizing the deployments that need to be approved and is attempting to approve them. The notices s
Mar 3 16:28
@Ashar Dont forget to add @VonC in your replies in this chat, for me to be notified.
Mar 3 15:02
@Ashar OK, I was trying to add all four, not all three
Mar 3 15:02
@Ashar In your job execution, the script does not add item2 and item4 to the matrix because they do not match the *_* pattern used in the if condition. If you intend for item2 and item4 to be part of the matrix as well, you would need to adjust the logic accordingly. For example, if all items need to be included, you could simply add them directly to $unique_envList without the if condition.
Mar 3 15:02
@Ashar No, I was more suggesting for your workflow to install and use Node 16 instead of 20.
Mar 3 15:02
@Ashar I understand you are using 1.0.6, but with node 20 instead of the node 16 used by the action (in case that matters).