FaunaDB Query Multiple Fields - faunadb

I am starting a project with faunadb, where users can login using either their email, username or phone number. Is there a way to query fauna for any of those 3 fields submitted by the user?

Related

Bigquery - (GA4 data) - why the number of user ID's do not match Unique Users Metrics?

I do have my GA4 property connected to Bigquery. I use my own user_id for tracking - its available once someone logs into my app.
For some reason, when I'm trying to build a report User ID string vs Unique Users, some ID's have more than 1 Unique User reported. Showing an example on the attached image.
Why is that and how I can fix that situation? I'd expect that one ID = One User
User ID vs Number of Users

AWS Cognito Batch Query

Is it possible to query AWS cognito with a list of user ids? Let's say i have user ids List : userid1,userid2,userid3,userid4,userid5,userid6
I know how to get an users one by one using their id or email address, but I was wondering if it is possible to get the users in a batch query using their ids or emails.
I use golang, but I can use any other language thanks in advance.
You can't do it directly, but maybe you could use https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_ListUsers.html with a filter condition, but it has this limitation:
You can only search for the following standard attributes:
username (case-sensitive)
email
phone_number
name
given_name
family_name
preferred_username
cognito:user_status (called Status in the Console) (case-insensitive)
status (called Enabled in the Console) (case-sensitive)
sub
Custom attributes are not searchable.
Mostly filter won't work, because it only supports 2 conditions: "=" and "begin with".
I guess you have to use promise.all()

LDAP authentication filter to validate which employee is belong to which group

I am doing LDAP authentication for the user.
Steps are -
1. when users enter his username on the login screen.
2. The request goes to the LDAP server and will try to validate the user against its corresponding group
filter :="(|(employeeNumber=deeps)(memberOf=CN=DEV_Admin,OU=LDAP,DC=TEMP,DC=com))"
This filter works fine and giving me the employee details of the relevant group.
Now the requirement changes -
When the user enters his employeeNumber =deeps
we have to validate him against different groups for example
(memberOf=CN=DEV_Admin,OU=LDAP,DC=TEMP,DC=com)
(memberOf=CN=DEV_View,OU=LDAP,DC=TEMP,DC=com)
(memberOf=CN=DEV_Partial,OU=LDAP,DC=TEMP,DC=com)
Can anyone help me with writing a proper filter which checks against all those groups and gives me the user in one filter rather than writing three LDAP requests?
The filter seems incorrect to me as it tests if the employeeNumber is deeps OR if entries are in the Dev_Admin group. It seems to me that you want an AND, not an OR.
To check the 3 groups, it would be the following filter:
(&(employeeNumber=deeps)(|(memberOf=CN=DEV_Admin,OU=LDAP,DC=TEMP,DC=com)(memberOf=CN=DEV_View,OU=LDAP,DC=TEMP,DC=com)(memberOf=CN=DEV_Partial,OU=LDAP,DC=TEMP,DC=com)))

JIRA Api for 'Find users with browse permission ' not working

I am trying to get a list of users who have access to a particular issue.
I tried using GET /rest/api/2/user/viewissue/search for this . But it asks for username and issueKey query parameters. Also it is returning only one user.
How does this api work?
I refered to the documentation here: https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-user-viewissue-search-get
EDIT to the below: If you query with username=% (i.e. a wildcard) then it returns
every user with permission
As the documentation you've linked to states, you do need to provide an issueKey and a username or it won't return any results:
username
string
the username filter, no users returned if left blank
This is saying, find all the users who have permission to see the specified issue, where their username matches this specific filter value I'm providing, i.e. not all users that have permission.
It's filtering on some combination of username, display name and email (I think).
I have a JIRA Cloud site with three users:
admin, which has a display name of Mike Jones and an email of mike.jones#...
mike, which has a display name of Mike Jones and an email of mike.jones#...
mike.jones, which has a display name of Mike Smith and an email of mike.jones#...
If I run this query, I see all three users returned:
https://<url>/rest/api/2/user/viewissue/search?issueKey=DD-1&username=mike
If I change the last query parameter to be username=smith then I see just the third user with a display name of Mike Smith, which suggests it's querying the Display Name field:
https://<url>/rest/api/2/user/viewissue/search?issueKey=DD-1&username=smith
But if I use the parameter username=jones, then I see all three users, which suggests it's querying the Email field:
https://<url>/rest/api/2/user/viewissue/search?issueKey=DD-1&username=jones
And if I use the parameter username=admin, then I only see the admin user, which suggests it's querying on the Username field:
https://<url>/rest/api/2/user/viewissue/search?issueKey=DD-1&username=admin

Creating a login table in SQL

My objective is to create a table that stores the information of the users and their passwords. Also, I want to keep track the number of failed logins. However, Here is a brief description about the tables:
First: the table of users
UserNo: ID of the user
Name: user's name
Email
Second: the table of login
UserNo: is the same as the last one
Password
Third: the table of tracking
UserNo
DateTime: date and time of login
count: counter that increases every time the user logins incorrectly.
From the last three tables, I do not think what I have done is a professional way. Is there any better ideas? especially with the tracking table.
Thanks
A couple of points:
There's no reason for your second table unless you're going to keep a password history (in which case you need an additional field to track the date the password was created)
In the third table, don't use a counter for the number of incorrect logins; instead, write a record for every login attempt (successful or otherwise), and use a query to retrieve the count whenever you need it.
Why are you keeping them separate? Why not just have a users table with the id, username, password hash, last login date and failed attempts counter?
Otherwise you could separate out login attempts to it's own table and record a status e.g. SUCCESS or FAIL so you can procedurally calculate number of failed attempts since the last successful one, and it also provides a full audit of logins, failed or not.
You might want to merge the first two tables together, as there is only one password per user, so it makes sense to have all the data for a user on one row in one table.
The third table records the timestamp of each login, and could also record the timestamp of each failed login if you added an extra column, then a quesy will give you a count of total failed logins per user.
Or, if you are counting the number of failed logins since last login, then you could just put the counter in the first table again.
You can put all your fields in a single table
UserID, UserName, UserEmail, Password, Login_Timestamp, Counter
then you can save all the values in a single table