Skip to content

Commit

Permalink
refactor: change package name (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruv1294 authored Dec 20, 2021
1 parent 9ec2d30 commit 13025e4
Show file tree
Hide file tree
Showing 40 changed files with 77 additions and 78 deletions.
2 changes: 1 addition & 1 deletion DauthSDK/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="edu.nitt.delta">
package="edu.nitt.delta.auth">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission
android:name="android.permission.AUTHENTICATE_ACCOUNTS"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.nitt.delta
package edu.nitt.delta.auth

import android.accounts.Account
import android.accounts.AccountManager
Expand All @@ -7,18 +7,18 @@ import android.app.AlertDialog
import android.net.Uri
import android.util.Base64
import com.google.gson.GsonBuilder
import edu.nitt.delta.api.RetrofitInstance
import edu.nitt.delta.constants.AccountManagerConstants
import edu.nitt.delta.constants.ErrorMessageConstants
import edu.nitt.delta.constants.WebViewConstants.BaseAuthority
import edu.nitt.delta.constants.WebViewConstants.BaseUrl
import edu.nitt.delta.constants.WebViewConstants.Scheme
import edu.nitt.delta.helpers.PkceUtil
import edu.nitt.delta.helpers.isNetworkAvailable
import edu.nitt.delta.helpers.openWebView
import edu.nitt.delta.helpers.toMap
import edu.nitt.delta.interfaces.ResultListener
import edu.nitt.delta.models.*
import edu.nitt.delta.auth.api.RetrofitInstance
import edu.nitt.delta.auth.constants.AccountManagerConstants
import edu.nitt.delta.auth.constants.ErrorMessageConstants
import edu.nitt.delta.auth.constants.WebViewConstants.BaseAuthority
import edu.nitt.delta.auth.constants.WebViewConstants.BaseUrl
import edu.nitt.delta.auth.constants.WebViewConstants.Scheme
import edu.nitt.delta.auth.helpers.PkceUtil
import edu.nitt.delta.auth.helpers.isNetworkAvailable
import edu.nitt.delta.auth.helpers.openWebView
import edu.nitt.delta.auth.helpers.toMap
import edu.nitt.delta.auth.interfaces.ResultListener
import edu.nitt.delta.auth.models.*
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package edu.nitt.delta
package edu.nitt.delta.auth

import android.accounts.Account
import android.accounts.AccountAuthenticatorResponse
import android.accounts.AccountManager
import android.app.Activity
import android.net.Uri
import android.os.Bundle
import edu.nitt.delta.constants.AccountManagerConstants
import edu.nitt.delta.constants.ErrorCodeConstants
import edu.nitt.delta.constants.ErrorMessageConstants
import edu.nitt.delta.constants.WebViewConstants
import edu.nitt.delta.helpers.toFormatString
import edu.nitt.delta.helpers.openWebView
import edu.nitt.delta.helpers.retrieveCookie
import edu.nitt.delta.auth.constants.AccountManagerConstants
import edu.nitt.delta.auth.constants.ErrorCodeConstants
import edu.nitt.delta.auth.constants.ErrorMessageConstants
import edu.nitt.delta.auth.constants.WebViewConstants
import edu.nitt.delta.auth.helpers.toFormatString
import edu.nitt.delta.auth.helpers.openWebView
import edu.nitt.delta.auth.helpers.retrieveCookie
import java.util.*

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.nitt.delta
package edu.nitt.delta.auth

import android.accounts.AbstractAccountAuthenticator
import android.accounts.Account
Expand All @@ -7,12 +7,11 @@ import android.accounts.AccountManager
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.util.Log
import edu.nitt.delta.api.RetrofitInstance
import edu.nitt.delta.constants.ErrorCodeConstants
import edu.nitt.delta.constants.ErrorMessageConstants
import edu.nitt.delta.helpers.toDate
import edu.nitt.delta.helpers.toFormatString
import edu.nitt.delta.auth.api.RetrofitInstance
import edu.nitt.delta.auth.constants.ErrorCodeConstants
import edu.nitt.delta.auth.constants.ErrorMessageConstants
import edu.nitt.delta.auth.helpers.toDate
import edu.nitt.delta.auth.helpers.toFormatString
import okhttp3.ResponseBody
import retrofit2.Call
import retrofit2.Callback
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.nitt.delta
package edu.nitt.delta.auth

import android.app.Service
import android.content.Intent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.nitt.delta.api
package edu.nitt.delta.auth.api

/**
* Singleton object containing the [api routes](https://delta.github.io/DAuth-Docs/#endpoints)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package edu.nitt.delta.api
package edu.nitt.delta.auth.api

import edu.nitt.delta.models.Token
import edu.nitt.delta.models.User
import edu.nitt.delta.models.jwks
import edu.nitt.delta.auth.models.Token
import edu.nitt.delta.auth.models.User
import edu.nitt.delta.auth.models.jwks
import okhttp3.ResponseBody
import retrofit2.Call
import retrofit2.http.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.nitt.delta.api
package edu.nitt.delta.auth.api

import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.nitt.delta.constants
package edu.nitt.delta.auth.constants

object AccountManagerConstants {
const val AccountType = "auth.delta.nitt.edu"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.nitt.delta.constants
package edu.nitt.delta.auth.constants

object ErrorCodeConstants {
const val InternalError=404
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.nitt.delta.constants
package edu.nitt.delta.auth.constants

object ErrorMessageConstants {
const val NoAccount="Account Not Found"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.nitt.delta.constants
package edu.nitt.delta.auth.constants

internal object WebViewConstants {
const val Scheme = "https"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.nitt.delta.deltaButton
package edu.nitt.delta.auth.deltaButton

import android.annotation.SuppressLint
import android.content.Context
Expand All @@ -10,9 +10,9 @@ import android.graphics.Color
import android.graphics.Paint
import android.graphics.Rect
import androidx.core.content.ContextCompat
import edu.nitt.delta.R
import edu.nitt.delta.helpers.ViewUtils.dpToPixel
import edu.nitt.delta.helpers.ViewUtils.drawableToBitmap
import edu.nitt.delta.auth.R
import edu.nitt.delta.auth.helpers.ViewUtils.dpToPixel
import edu.nitt.delta.auth.helpers.ViewUtils.drawableToBitmap

/**
* An open [DeltaButton] class to integrate with the client UI
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.nitt.delta.helpers
package edu.nitt.delta.auth.helpers

import android.content.Context
import android.net.ConnectivityManager
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.nitt.delta.helpers
package edu.nitt.delta.auth.helpers

import java.text.SimpleDateFormat
import java.util.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.nitt.delta.helpers
package edu.nitt.delta.auth.helpers

import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.nitt.delta.helpers
package edu.nitt.delta.auth.helpers

import android.util.Base64
import java.security.MessageDigest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.nitt.delta.helpers
package edu.nitt.delta.auth.helpers

import android.content.Context
import android.content.res.Resources
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.nitt.delta.helpers
package edu.nitt.delta.auth.helpers

import android.R
import android.app.Dialog
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.nitt.delta.interfaces
package edu.nitt.delta.auth.interfaces

interface ResultListener<T> {
fun onSuccess(value: T)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.nitt.delta.models
package edu.nitt.delta.auth.models

enum class AuthorizationErrorType {
NetworkError,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.nitt.delta.models
package edu.nitt.delta.auth.models

data class AuthorizationRequest(
val response_type: ResponseType,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.nitt.delta.models
package edu.nitt.delta.auth.models

data class AuthorizationResponse(
val authorizationCode : String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.nitt.delta.models
package edu.nitt.delta.auth.models

data class ClientCredentials(
val clientId: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.nitt.delta.models
package edu.nitt.delta.auth.models

enum class GrantType {
AuthorizationCode {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.nitt.delta.models
package edu.nitt.delta.auth.models

data class Key(
val e: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.nitt.delta.models
package edu.nitt.delta.auth.models

enum class ResponseType {
Code{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.nitt.delta.models
package edu.nitt.delta.auth.models

data class Result(
val user: User?,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.nitt.delta.models
package edu.nitt.delta.auth.models

enum class Scope {
OpenID {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.nitt.delta.models
package edu.nitt.delta.auth.models

data class Token(
val access_token: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.nitt.delta.models
package edu.nitt.delta.auth.models

data class TokenRequest(
val grant_type:String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.nitt.delta.models
package edu.nitt.delta.auth.models

data class User(
val id: Int,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.nitt.delta.models
package edu.nitt.delta.auth.models

data class jwks (
val key: List<Key>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.nitt.delta.models
package edu.nitt.delta.auth.models

data class jwt(
val header: Header,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".DAuthAuthenticatorActivity">
tools:context=".auth.DAuthAuthenticatorActivity">
</androidx.constraintlayout.widget.ConstraintLayout>
2 changes: 1 addition & 1 deletion sampleApp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ android {
compileSdk 30

defaultConfig {
applicationId "edu.nitt.delta"
applicationId "edu.nitt.delta.auth.sample"
minSdk 21
targetSdk 30
versionCode 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package edu.nitt.delta;
package edu.nitt.delta.auth.sample;

import android.os.Bundle;
import android.util.Log;
Expand All @@ -8,14 +8,14 @@
import androidx.appcompat.app.AppCompatActivity;
import java.util.ArrayList;
import java.util.List;
import edu.nitt.delta.deltaButton.DeltaButton;
import edu.nitt.delta.interfaces.ResultListener;
import edu.nitt.delta.models.AuthorizationRequest;
import edu.nitt.delta.models.GrantType;
import edu.nitt.delta.models.ResponseType;
import edu.nitt.delta.models.Result;
import edu.nitt.delta.models.Scope;
import edu.nitt.delta.models.User;
import edu.nitt.delta.auth.DAuth;
import edu.nitt.delta.auth.deltaButton.DeltaButton;
import edu.nitt.delta.auth.interfaces.ResultListener;
import edu.nitt.delta.auth.models.AuthorizationRequest;
import edu.nitt.delta.auth.models.GrantType;
import edu.nitt.delta.auth.models.ResponseType;
import edu.nitt.delta.auth.models.Result;
import edu.nitt.delta.auth.models.Scope;

/**
* Sample activity in java to show the use of DAuth sign in
Expand Down
2 changes: 1 addition & 1 deletion sampleApp/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="edu.nitt.delta">
package="edu.nitt.delta.auth.sample">

<application
android:allowBackup="false"
Expand Down
2 changes: 1 addition & 1 deletion sampleApp/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
android:layout_height="match_parent"
tools:context=".MainActivity">

<edu.nitt.delta.deltaButton.DeltaButton
<edu.nitt.delta.auth.deltaButton.DeltaButton
android:id="@+id/sign_in_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand Down

0 comments on commit 13025e4

Please sign in to comment.