-
Notifications
You must be signed in to change notification settings - Fork 223
[androidChatExample] Updated android example to consume SDK #239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,4 @@ | |||
// Learn more https://docs.expo.io/guides/customizing-metro | |||
const { getDefaultConfig } = require('expo/metro-config'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommendation generated by Amazon CodeGuru Reviewer. Leave feedback on this recommendation by replying to the comment or by reacting to the comment using emoji.
We detected that you are importing a module inside a function, which is known as lazy loading. If modules are imported within a function, it might prevent other requests from being handled at a more critical time. We recommend that you load all modules at the beginning of each file, before and outside of any functions.
} | ||
|
||
// Upload a selected attachment to the chat session | ||
fun uploadAttachment(fileUri: Uri) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommendation generated by Amazon CodeGuru Reviewer. Leave feedback on this recommendation by replying to the comment or by reacting to the comment using emoji.
There is a lack of authentication on critical function. If an application fails to verify authentication before allowing access to sensitive functions or data it can lead to unauthorized users performing critical operations or accessing confidential information. To mitigate this, ensure critical functions are protected by authentication and authorization checks like usage of @PreAuthorize(...) or @secured(...) annotations. Use role-based access control (RBAC) to restrict sensitive actions to authorized users, and implement proper security mechanisms to verify identity before allowing such actions. Learn more https://cwe.mitre.org/data/definitions/306.html
|
||
@Singleton | ||
@Provides | ||
fun providesUserApi(): ApiInterface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommendation generated by Amazon CodeGuru Reviewer. Leave feedback on this recommendation by replying to the comment or by reacting to the comment using emoji.
There is a lack of authentication on critical function. If an application fails to verify authentication before allowing access to sensitive functions or data it can lead to unauthorized users performing critical operations or accessing confidential information. To mitigate this, ensure critical functions are protected by authentication and authorization checks like usage of @PreAuthorize(...) or @secured(...) annotations. Use role-based access control (RBAC) to restrict sensitive actions to authorized users, and implement proper security mechanisms to verify identity before allowing such actions. Learn more https://cwe.mitre.org/data/definitions/306.html
|
||
@HiltAndroidApp | ||
class ChatApplication: Application() { | ||
override fun onCreate() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommendation generated by Amazon CodeGuru Reviewer. Leave feedback on this recommendation by replying to the comment or by reacting to the comment using emoji.
There is a lack of authentication on critical function. If an application fails to verify authentication before allowing access to sensitive functions or data it can lead to unauthorized users performing critical operations or accessing confidential information. To mitigate this, ensure critical functions are protected by authentication and authorization checks like usage of @PreAuthorize(...) or @secured(...) annotations. Use role-based access control (RBAC) to restrict sensitive actions to authorized users, and implement proper security mechanisms to verify identity before allowing such actions. Learn more https://cwe.mitre.org/data/definitions/306.html
} | ||
|
||
// Create a connection to the participant chat session | ||
private fun createParticipantConnection(chatDetails: ChatDetails) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommendation generated by Amazon CodeGuru Reviewer. Leave feedback on this recommendation by replying to the comment or by reacting to the comment using emoji.
There is a lack of authentication on critical function. If an application fails to verify authentication before allowing access to sensitive functions or data it can lead to unauthorized users performing critical operations or accessing confidential information. To mitigate this, ensure critical functions are protected by authentication and authorization checks like usage of @PreAuthorize(...) or @secured(...) annotations. Use role-based access control (RBAC) to restrict sensitive actions to authorized users, and implement proper security mechanisms to verify identity before allowing such actions. Learn more https://cwe.mitre.org/data/definitions/306.html
} | ||
|
||
// Update the transcript when new messages or events are received | ||
private fun onUpdateTranscript(transcriptList: List<TranscriptItem>) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommendation generated by Amazon CodeGuru Reviewer. Leave feedback on this recommendation by replying to the comment or by reacting to the comment using emoji.
There is a lack of authentication on critical function. If an application fails to verify authentication before allowing access to sensitive functions or data it can lead to unauthorized users performing critical operations or accessing confidential information. To mitigate this, ensure critical functions are protected by authentication and authorization checks like usage of @PreAuthorize(...) or @secured(...) annotations. Use role-based access control (RBAC) to restrict sensitive actions to authorized users, and implement proper security mechanisms to verify identity before allowing such actions. Learn more https://cwe.mitre.org/data/definitions/306.html
class MainActivity : ComponentActivity() { | ||
private lateinit var chatViewModel: ChatViewModel | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommendation generated by Amazon CodeGuru Reviewer. Leave feedback on this recommendation by replying to the comment or by reacting to the comment using emoji.
There is a lack of authentication on critical function. If an application fails to verify authentication before allowing access to sensitive functions or data it can lead to unauthorized users performing critical operations or accessing confidential information. To mitigate this, ensure critical functions are protected by authentication and authorization checks like usage of @PreAuthorize(...) or @secured(...) annotations. Use role-based access control (RBAC) to restrict sensitive actions to authorized users, and implement proper security mechanisms to verify identity before allowing such actions. Learn more https://cwe.mitre.org/data/definitions/306.html
Issue #, if available:
Description of changes:
Updating android chat example with latest example from SDK project, here
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.