Move login to auth package

This commit is contained in:
Mikołaj Pich 2018-08-21 20:04:47 +02:00
parent 5f9e9778a0
commit 5190fbf218
No known key found for this signature in database
GPG key ID: F62B26E36D4C4BAA
8 changed files with 11 additions and 10 deletions

View file

@ -1,3 +1,3 @@
package io.github.wulkanowy.api.login
package io.github.wulkanowy.api.auth
class AccountPermissionException internal constructor(message: String) : VulcanException(message)

View file

@ -1,3 +1,3 @@
package io.github.wulkanowy.api.login
package io.github.wulkanowy.api.auth
class BadCredentialsException internal constructor(message: String) : VulcanException(message)

View file

@ -1,4 +1,4 @@
package io.github.wulkanowy.api.login
package io.github.wulkanowy.api.auth
import org.jsoup.nodes.Document
import java.net.HttpCookie

View file

@ -1,4 +1,4 @@
package io.github.wulkanowy.api.login
package io.github.wulkanowy.api.auth
import org.jsoup.Jsoup
import org.jsoup.nodes.Document
@ -21,6 +21,7 @@ class Login(private val client: Client) {
private val logger = LoggerFactory.getLogger(Login::class.java)
}
//TODO: replace with request retry
private var lastSuccessRequest: Date? = null
fun isLoggedIn(): Boolean {
@ -95,7 +96,7 @@ class Login(private val client: Client) {
val targetDoc = sendCertData(doc)
var title = targetDoc.title()
if ("Working..." == title) { // on adfs login
if ("Working..." == title) {
logger.info("ADFS login")
title = sendCertData(targetDoc).title()
}

View file

@ -1,3 +1,3 @@
package io.github.wulkanowy.api.login
package io.github.wulkanowy.api.auth
internal class LoginErrorException(message: String) : NotLoggedInErrorException(message)

View file

@ -1,3 +1,3 @@
package io.github.wulkanowy.api.login
package io.github.wulkanowy.api.auth
open class NotLoggedInErrorException(message: String) : VulcanException(message)

View file

@ -1,4 +1,4 @@
package io.github.wulkanowy.api.login
package io.github.wulkanowy.api.auth
open class VulcanException : Exception {

View file

@ -1,7 +1,7 @@
package io.github.wulkanowy.api.interceptor
import io.github.wulkanowy.api.login.Client
import io.github.wulkanowy.api.login.Login
import io.github.wulkanowy.api.auth.Client
import io.github.wulkanowy.api.auth.Login
import okhttp3.*
import okhttp3.logging.HttpLoggingInterceptor
import org.jsoup.Jsoup