Handle public instances #126
No reviewers
Labels
No Label
Difficulty - Beginner friendly
Difficulty = Easy
Difficulty = Hard
Difficulty = Medium
Priority = CRITICAL
Priority = High
Priority = Low
Priority = Normal
Priority = Some day
Status - Fixed somewhere else
Status - No details provided
Status = Can't fix
Status = Duplicate
Status = Help wanted
Status = Invalid
Status = Need more details
Status = Taken
Status = Wontfix
Type - Selfoss works like this
Type = Bug
Type = Chore
Type = Enhancement
Type = Feature
Type = Question
Type = SELFOSS API ISSUE
Type = Tools
Type = UX/Design
Up For Grabs
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Louvorg/ReaderForSelfoss-multiplatform#126
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "davidoskky/ReaderForSelfoss-multiplatform:public"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Types of changes
This is implements feature #106
This supports public instances by disabling any kind of unauthorized action.
There's a problem with sources: these are not correctly being fetched because we use the /sources/list api endpoint which is not publicly accessible rather than /sources/stats which is. https://github.com/fossar/selfoss/issues/1403
I'm unsure whether to include changes to fetching sources in this PR or to create a new one for that. This is currently complete and working, however it's impossible to filter by source.
@ -85,3 +85,3 @@
private fun readItem(item: SelfossModel.Item) {
if (appSettingsService.isMarkOnScrollEnabled()) {
if (appSettingsService.isMarkOnScrollEnabled() and !appSettingsService.getPublicAccess()) {
and
should be changed to&&
.We do not care about the value of
appSettingsService.getPublicAccess()
ifappSettingsService.isMarkOnScrollEnabled()
is false.@ -95,4 +94,3 @@
app:layout_constraintTop_toBottomOf="@+id/sourceTitleAndDate">
<ImageButton
android:id="@+id/favButton"
Why was the buttons order changed ?
The button order stays the same in the application as it currently is. This change allows the buttons to disappear dynamically and still align to the end of the layout.
@ -49,0 +51,4 @@
fun getApiConfiguration() = configuration ?: ApiConfiguration(null, null)
}
@kotlinx.serialization.Serializable
Can be changed to
@Serializable
@ -449,0 +450,4 @@
}
if (appSettingsService.getUserName().isEmpty()
&& fetchedInformation.data.getApiConfiguration().isAuthEnabled()
&& fetchedInformation.data.getApiConfiguration().isPublicModeEnabled()) {
I didn't look into how public instances work, but this condition seems weird.
isAuthEnabled
andisPublicModeEnabled
can betrue
at the same time ?They seem to mean different things.
Yes, it is the normal case in fact; the weird condition is actually
isAuthEnabled
false
andisPublicModeEnabled
true
.Authentication is enabled because the administrator user can log in and read/favourite articles or edit sources while everyone else can just read the articles (and not mark them as read). Having authentication disabled simply means that no password is required to access and thus everyone is administrator, in this case it would make no sense to enable public mode as well.
Can you please add this to a comment ?
@ -449,0 +451,4 @@
if (appSettingsService.getUserName().isEmpty()
&& fetchedInformation.data.getApiConfiguration().isAuthEnabled()
&& fetchedInformation.data.getApiConfiguration().isPublicModeEnabled()) {
appSettingsService.updatePublicAccess(true)
appSettingsService.updatePublicAccess(fetchedInformation.data.getApiConfiguration().isPublicModeEnabled())
isn't enough ?No, public mode might be enabled but we could still log into the instance with username and password.
Public mode has limitations, thus if one had the credentials to access the instance, that would actually be the preferred option.
I'll rectify to explain what I mean. In the settings I am not storing the remote value of the configuration, I am directly storing whether we connected through public mode or not; in this way in any point of the application in which this information is required, that'll be readily available without any further processing. That's because we could connect trough the normal authentication method even if public mode was enabled.
Alternatively, I'd have to store both values of the remote configuration:
isPublicModeEnabled
andisAuthEnabled
and each time check if these imply that we're connecting through public mode.Since we are not using these information for anything else, storing it would be redundant.