Skip to content
Open

Dev #16

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
229 commits
Select commit Hold shift + click to select a range
be3b4f6
tests_added
ahmedglez Apr 9, 2023
03d54d8
server-sanitation
ahmedglez Apr 9, 2023
fdfa613
pagination_and_querys_added
ahmedglez Apr 10, 2023
cd27ca5
adding group routes
ahmedglez Apr 10, 2023
6abac7e
helmet middleware added
ahmedglez Apr 10, 2023
efb1af8
added express-rate-limit middleware
ahmedglez Apr 10, 2023
174af71
ldap_binding_admin
ahmedglez Apr 12, 2023
84c9334
change_login_response_to_incorrect_credentials
ahmedglez Apr 12, 2023
7ad4783
adding_roles_on_jwt
ahmedglez Apr 12, 2023
e461eb8
roles_middleware_added
ahmedglez Apr 12, 2023
2c4e7fe
added pagination and students filters
ahmedglez Apr 25, 2023
722bf9d
add user endpoint
ahmedglez Apr 26, 2023
e3174c7
updating profile
ahmedglez Apr 26, 2023
ef60416
adding server-monitor
ahmedglez Apr 26, 2023
4745960
integration test passed
ahmedglez Apr 27, 2023
fa43ecf
authentication working with new ldap
ahmedglez Jun 9, 2023
3370ce9
limit query working fine
ahmedglez Jun 26, 2023
e576b28
get by username working ok
ahmedglez Jun 26, 2023
a264ff4
get users by year working fine
ahmedglez Jun 26, 2023
d258fb8
cache middleware added
ahmedglez Jun 27, 2023
864c6b2
add cache middleware
ahmedglez Aug 2, 2023
0a27bbe
query to filters
ahmedglez Aug 2, 2023
d7e2ad2
return entire user on login
ahmedglez Aug 2, 2023
78e4f82
showing user uid on log middleware
ahmedglez Aug 3, 2023
5160429
add filtering logs endpoints
ahmedglez Aug 4, 2023
00dedd0
add uid to jwt payload
ahmedglez Aug 4, 2023
a9dd13d
protect database connection in case of error
ahmedglez Aug 21, 2023
63e4762
Validate ldap connection error
ahmedglez Aug 21, 2023
2f09ca2
Go back on ldap connection
ahmedglez Aug 21, 2023
aaf491b
Retrieve last time logged from DB on login
ahmedglez Aug 21, 2023
8db50d9
add registry and deserialization
ahmedglez Aug 21, 2023
9dea5da
Send login Info by jwt
ahmedglez Aug 22, 2023
1ebb9d2
add dnHelpers and pass groups, base and uid by jwt
ahmedglez Aug 29, 2023
3c36f54
add src require alias
ahmedglez Aug 29, 2023
8114d34
filter users by group
ahmedglez Aug 29, 2023
d19063c
fix imports on test
ahmedglez Aug 29, 2023
6986a0c
apply pagination on user service
ahmedglez Aug 30, 2023
4913e38
convert query to filter function added : )
ahmedglez Aug 30, 2023
b93ad4d
replace get by username endpoint for generic query
ahmedglez Aug 30, 2023
5b45f94
replace get by CI endpoint for generic query
ahmedglez Aug 30, 2023
cecbb54
replace get by email endpoint for generic query
ahmedglez Aug 30, 2023
d97a95e
get all endpoint implemented
ahmedglez Aug 30, 2023
d5a75c6
auth login fixed
ahmedglez Aug 30, 2023
7c8707c
add query filtering to groups endpoint
ahmedglez Aug 30, 2023
b8ceb64
return all attributes on search
ahmedglez Aug 30, 2023
17932b8
search group by name endpoint
ahmedglez Aug 30, 2023
79e1ec5
get by baseDN endpoint added
ahmedglez Aug 30, 2023
eb3915b
update get by baseDN to be a post petition
ahmedglez Aug 30, 2023
0de3946
massive file clean
ahmedglez Aug 30, 2023
f82804b
refactor auth method
ahmedglez Aug 30, 2023
f4f2f72
clean imports on user routes
ahmedglez Aug 30, 2023
262a3e0
add userType filter endpoint
ahmedglez Aug 30, 2023
e68b759
refact convet query to filter helper
ahmedglez Aug 30, 2023
5f1edb0
add query validator middleware
ahmedglez Aug 30, 2023
0bde674
add query validation middleware to baseDN endpoint
ahmedglez Aug 30, 2023
f0ab632
add db connection error validation to logger midd
ahmedglez Sep 4, 2023
2e364cc
add error on reauthentication in less than 15 min
ahmedglez Sep 4, 2023
7d464b1
change let declarations to const
ahmedglez Sep 4, 2023
3f2225a
add redis client
ahmedglez Sep 6, 2023
7a7c849
update method added
ahmedglez Sep 6, 2023
d3e816b
heckLastAuthentication commented
ahmedglez Sep 6, 2023
94cd352
redis test connection passed
ahmedglez Sep 6, 2023
2de6aeb
ldap connection test added
ahmedglez Sep 6, 2023
c277686
move ldapUtils from helpers to utils
ahmedglez Sep 6, 2023
4b56581
migrate client and test to redis instead redis-om
ahmedglez Sep 6, 2023
bd9837a
add auth services test
ahmedglez Sep 7, 2023
a0cdb4f
logout method added
ahmedglez Sep 7, 2023
0576f51
add method to check is blacklisted token
ahmedglez Sep 7, 2023
f3e52af
add expired token middleware
ahmedglez Sep 7, 2023
ee09835
set session expiredTime to 15 min instead 1 day
ahmedglez Sep 7, 2023
f7b8960
forbit users to log in if already has a session
ahmedglez Sep 7, 2023
485ff1f
add session middleware test
ahmedglez Sep 7, 2023
f21513d
destroy user session on logout
ahmedglez Sep 7, 2023
cce386e
save and delete refreshToken on login and logout
ahmedglez Sep 8, 2023
b295af8
logout working ok
ahmedglez Sep 8, 2023
b975eb8
refactor auth services
ahmedglez Sep 8, 2023
4853a30
retrieve new token and refreshToken on refresh endpoint
ahmedglez Sep 8, 2023
05c768b
check undefined on logger when refresh token
ahmedglez Sep 9, 2023
6ca3338
add jest.config file
ahmedglez Sep 11, 2023
e4b1eba
add get group by CN endpoint
ahmedglez Sep 11, 2023
d0c89a7
add admin and superadmin roles fetched from ldap
ahmedglez Sep 11, 2023
40cd6dc
update active session error handleling in log in
ahmedglez Sep 11, 2023
23b02dd
allow to search only in localBranch
ahmedglez Sep 11, 2023
021bbf2
add mongoose connection file
ahmedglez Sep 11, 2023
8700124
add aditional dependencies
ahmedglez Sep 11, 2023
61c477a
add email template
ahmedglez Sep 11, 2023
b448a3f
remove fynamic link fomr html template
ahmedglez Sep 11, 2023
cfcb917
add email utils
ahmedglez Sep 11, 2023
fa02745
adapt login to search method
ahmedglez Sep 11, 2023
2cf12f3
add userAndRecoveryCode schema
ahmedglez Sep 11, 2023
32d6d99
add userRecoveryCode and pssword validation schema
ahmedglez Sep 11, 2023
893a6e1
refactor get by username and email service
ahmedglez Sep 11, 2023
aafc6db
add forgot password feature
ahmedglez Sep 11, 2023
e9250e9
send code by email
ahmedglez Sep 11, 2023
9783a29
add password validation middleware
ahmedglez Sep 12, 2023
6b63cdc
validate password before update
ahmedglez Sep 12, 2023
859750a
send token on forgot password
ahmedglez Sep 12, 2023
6b9917c
add check recovery code validation
ahmedglez Sep 12, 2023
2758c00
update password method finished
ahmedglez Sep 12, 2023
e7d827a
add email notification to password change
ahmedglez Sep 12, 2023
2cec983
change blue color for cujae green
ahmedglez Sep 12, 2023
03a3c49
delete unnecessary dependencies
ahmedglez Sep 12, 2023
c3f1dab
rename password module
ahmedglez Sep 12, 2023
a92374b
update password endpoint added
ahmedglez Sep 12, 2023
8ad8e35
add email notification to update password endpoint
ahmedglez Sep 12, 2023
85e5b0b
update password change template
ahmedglez Sep 12, 2023
007dcbc
add filter by lastName
ahmedglez Sep 12, 2023
7f7ca71
add filter by sex
ahmedglez Sep 12, 2023
cfd5363
add filter by area
ahmedglez Sep 12, 2023
91745b3
add filter by userCondition
ahmedglez Sep 12, 2023
d892d6e
add filter by userStatus
ahmedglez Sep 12, 2023
2a7b211
add filter by sedeMunicipio
ahmedglez Sep 12, 2023
fd6a3be
add filter by userInformation
ahmedglez Sep 12, 2023
ea00cda
add filter by career
ahmedglez Sep 12, 2023
fff7aff
add filter by studentClassGroup
ahmedglez Sep 12, 2023
1be7ad3
add filter by studentYear
ahmedglez Sep 12, 2023
84e956b
add filter by country
ahmedglez Sep 12, 2023
cfdae85
add filter by UJC
ahmedglez Sep 12, 2023
5b028b4
add filter by skinColor
ahmedglez Sep 12, 2023
8219dec
add filter by sn and displayName
ahmedglez Sep 12, 2023
aaf9e22
add filter by mail and maildrop
ahmedglez Sep 12, 2023
7c294ec
add filter by dn and objectName
ahmedglez Sep 12, 2023
e57d32e
add employees att filters
ahmedglez Sep 12, 2023
c0ec616
get groups by DN
ahmedglez Sep 12, 2023
cacad8e
get groups in baseDN
ahmedglez Sep 13, 2023
06400e8
add scopedSearch method
ahmedglez Sep 13, 2023
ac58552
add get Childrens
ahmedglez Sep 13, 2023
6665cbf
add search by DN
ahmedglez Sep 13, 2023
ca026cb
add mongoose error connection on logger
ahmedglez Sep 16, 2023
9d30f79
add mongoose error connection
ahmedglez Sep 16, 2023
522c544
add try catch to ldap initialization
ahmedglez Sep 16, 2023
d591d72
add try catch to ldap client
ahmedglez Sep 16, 2023
4bd6ad0
add catch error validations
ahmedglez Sep 16, 2023
b41e49e
fix login bug
ahmedglez Sep 22, 2023
f32465c
fix undefined bug on user.uid
ahmedglez Sep 22, 2023
c6db4e5
validate role before fecth users from ldap
ahmedglez Sep 23, 2023
64ea7a9
clean logs on login
ahmedglez Sep 23, 2023
d5bfdc5
refactor logger and add more transports
ahmedglez Sep 23, 2023
c80b1d7
print uid from jwt instead of req.user
ahmedglez Sep 23, 2023
dcd97e2
save error logs into a separate log file
ahmedglez Sep 23, 2023
6c2c5d9
saving level correctly on db
ahmedglez Sep 23, 2023
3a5aa43
add dn and localBase to logs
ahmedglez Sep 23, 2023
3838995
clean logs
ahmedglez Sep 23, 2023
b4c63fc
add filters logs endpoint inside logs module
ahmedglez Sep 23, 2023
0a0e4f6
validate admin scope to access logs
ahmedglez Sep 23, 2023
73f75b5
sending logs by web socket
ahmedglez Sep 23, 2023
09b581e
send logs on streaming
ahmedglez Sep 23, 2023
1c0fd1b
add log file endpoint
ahmedglez Sep 23, 2023
7520fc8
add jwt validation to the file endpoint
ahmedglez Sep 23, 2023
178dd36
return json throw petition
ahmedglez Sep 23, 2023
330b0f3
add filters logs by daily, weekly and monthly
ahmedglez Sep 23, 2023
cf7e845
add search by group
ahmedglez Sep 24, 2023
5f6f302
add getGroups endpoint
ahmedglez Sep 24, 2023
02f3d03
filter groups by scope in querys
ahmedglez Sep 24, 2023
f341ad4
change get groups to post
ahmedglez Sep 24, 2023
ea44545
fix CI query endpoint
ahmedglez Sep 28, 2023
723ace7
add ldap update multiples atts
ahmedglez Sep 29, 2023
92295f7
increase the expiration time of the jwt
ahmedglez Oct 12, 2023
082e01d
update get methods to post
ahmedglez Oct 12, 2023
9e31038
add error and end listeners on ldap client
ahmedglez Oct 15, 2023
36cf1ea
add ldap function to add user
ahmedglez Oct 15, 2023
49bea92
add user endpoint created
ahmedglez Oct 15, 2023
52c1606
add validations to studet and employees
ahmedglez Oct 17, 2023
9e80f9c
add user correctly
ahmedglez Oct 18, 2023
1710978
install swagger dependencies
ahmedglez Oct 22, 2023
301d69c
swagger added and updating api folder structure
ahmedglez Oct 22, 2023
9d1aafd
update login and logout method to the new baseUrl
ahmedglez Oct 22, 2023
e0cf74d
fix json typo on jsonconfig
ahmedglez Oct 22, 2023
38b8b92
add swagger dep
ahmedglez Oct 22, 2023
df88bd6
update routes baseUrl
ahmedglez Oct 22, 2023
4ef879f
add swagger config
ahmedglez Oct 23, 2023
8d1e06a
users endpoint documented
ahmedglez Oct 23, 2023
fe94f10
profile endpoints documented
ahmedglez Oct 23, 2023
c1b438d
add tags to endpoint swagger paths
ahmedglez Oct 23, 2023
e5ce13f
groups controller documented
ahmedglez Oct 23, 2023
c103d85
documented authentication
ahmedglez Oct 23, 2023
917bbcc
logs documentation
ahmedglez Oct 23, 2023
9c6b986
password module documentation
ahmedglez Oct 23, 2023
ab507c5
add tags to swager.js
ahmedglez Oct 23, 2023
8c6ed21
add schemas to swagger.js
ahmedglez Oct 23, 2023
03c20a7
update tags for password module
ahmedglez Oct 23, 2023
bb99269
update tags for password module 2
ahmedglez Oct 23, 2023
a2127b9
remove comment from login method
ahmedglez Oct 23, 2023
51b3471
dn endpoint documentation
ahmedglez Oct 23, 2023
9e98e75
add tags
ahmedglez Oct 23, 2023
c8fc8bd
add postman collection
ahmedglez Oct 23, 2023
4b03f88
update refresh token path
ahmedglez Oct 23, 2023
4f9ac25
add callback function to refresh token
ahmedglez Oct 23, 2023
07db12a
fix reset password endpoint
ahmedglez Oct 23, 2023
0d2e756
update swagger server
ahmedglez Oct 27, 2023
f3c4985
user middlewares in users controller again
ahmedglez Oct 27, 2023
0d089c8
translate some responses
ahmedglez Nov 2, 2023
8e9d564
add new user registry function to login
ahmedglez Nov 3, 2023
3478ce9
update add user reject message
ahmedglez Nov 3, 2023
bf07ebb
add docker compose file
ahmedglez Nov 3, 2023
526adf6
config cors
ahmedglez Nov 10, 2023
72817c9
allow cors
ahmedglez Nov 10, 2023
21a81df
allow cors 2
ahmedglez Nov 10, 2023
1ec55b8
allow cors 3
ahmedglez Nov 10, 2023
f52761a
update swagger desc
ahmedglez Nov 18, 2023
59d4343
increase query params to handle user mistakes
ahmedglez Nov 18, 2023
5ccaa9c
delete logs on user controller
ahmedglez Nov 18, 2023
86f98b1
add api version to config file
ahmedglez Nov 18, 2023
289905f
add ldap version
ahmedglez Nov 18, 2023
b15f063
refactor logs controller
ahmedglez Nov 18, 2023
57d466e
fix status query filter
ahmedglez Nov 18, 2023
e84fe0f
add filtered logs by date
ahmedglez Nov 18, 2023
5bb671b
add error handleling on ldap operations
ahmedglez Nov 19, 2023
001aa05
update error message
ahmedglez Nov 19, 2023
1758bdf
update logs controller
ahmedglez Nov 20, 2023
4c26b69
update .env.example
ahmedglez Nov 30, 2023
69fb823
update tokens expiration time
ahmedglez Nov 30, 2023
f28beff
update user shcema
ahmedglez Nov 30, 2023
8c9515d
update ldap binding funcion
ahmedglez Nov 30, 2023
46a42ab
add swaggerdocs.json
ahmedglez Nov 30, 2023
a0954b1
add swageer pdf documentation
ahmedglez Nov 30, 2023
a420457
refactor authentication module
ahmedglez Dec 1, 2023
e480ff0
add sigenu integration module
ahmedglez Dec 1, 2023
10ce013
update morgan middleware to receive basic auth req
ahmedglez Dec 1, 2023
e96491f
add professor endpoint to sigenu_modules
ahmedglez Dec 1, 2023
2cac633
update postman collection
ahmedglez Dec 1, 2023
1c5aa60
update details
ahmedglez Dec 2, 2023
f220dab
add logs integration test
ahmedglez Dec 3, 2023
9986644
update auth controller
ahmedglez Dec 4, 2023
ffffbc5
comment blacklist
ahmedglez Dec 7, 2023
bfc35b2
add try catch to the update user controller
ahmedglez Dec 8, 2023
fed3222
update getByEmail service to user both
ahmedglez Dec 8, 2023
361331f
update mail services to send to all the
ahmedglez Dec 8, 2023
c31a2a3
update user and email
ahmedglez Dec 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
SERVER_HOST='127.0.0.1'
SERVER_PORT='4000'

MONGODB_URL='mongodb://127.0.0.1/yourDatabase'

SESSION_SECRET='superSecret'

LDAP_URL='ldap://example.com'
LDAP_PORT='389'
LDAP_DN='dc=example,dc=com'
LDAP_DN='dc=example,dc=com'SERVER_HOST='your_server_ip'
API_URL='http://your_server_ip:your_server_port'
LDAP_URL='ldap://your_ldap_host'
LDAP_PORT='your_ldap_port'
LDAP_BASE='your_ldap_base'
LDAP_DN='your_ldap_dn'
LDAP_PASS='your_ldap_password'
LDAP_USER_BIND='your_ldap_user_bind'
LDAP_SIZE_LIMIT='your_ldap_size_limit'
LDAP_TIME_LIMIT='your_ldap_time_limit'

ADMIN_USER='your_admin_user'
ADMIN_PASS='your_admin_password'

REDIS_URL='redis://your_redis_host:your_redis_port'

NODE_ENV='your_node_environment'

EMAIL_PASSWORD='your_email_password'
EMAIL_HOST='your_email_host'
EMAIL_USER='your_email_user'
EMAIL_CONTACT='your_email_contact'
Loading