It is narrated from Imam Sadeq (AS) in (the book of) Tohaful Oqool who said: A person who claims to be a believer and servant of God, must listen to what God says, follow the Divine Traditions, must have signs of the traditions of the Prophet (PBUH) and Imam (AS).
One of the Divine Traditions is that Allah (SWT) is aware of all the unseen as well as that which is open, as mentioned in Ayah 73 of Surah Al-An’aam but God does not tell the secrets to all people, you must also learn not to tell the secrets, your own secrets, your family secrets, your friends secrets, you must protect secrets, God does not make any acquainted with Divine Secrets and this is mentioned in Ayah 26 of Surah Al-Jinn. Imam Sadeq (AS) said: Keeping secrets is one of the main duties of the believers, they must have this Divine Morality in them [1].
Therefore, God keeps secrets and does not tell them to anyone, you also need to keep secrets and do not tell your secrets, your house secrets, your friends secrets to anyone. The tradition of the Prophet is to behave towards others with Divine Morality and the tradition of Imams is that be patient in difficulties until an opening occurs, and if all these are in a person, then he/she becomes a believer [2]
[1] Tafseer Kabeer,Vol. 7, Page 58.
[2] Tohaful Oqool, Page 312
source : SHAFAQNA