Skip to content
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

Implement Imperative Auth Design for ballerina/http Module #142

Merged
merged 25 commits into from
Jan 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
16f8eee
Comment out inbound auth related code
ldclakmal Dec 17, 2020
5c6f442
Add oauth2 and jwt dependencies
ldclakmal Dec 17, 2020
64fe715
Implement client authentication
ldclakmal Dec 21, 2020
ff7ac63
Remove commented inbound authentication
ldclakmal Dec 21, 2020
a5910d5
Implement listener authentication
ldclakmal Dec 22, 2020
0b6a8d2
Merge branch 'master' of https://github.com/ballerina-platform/module…
ldclakmal Dec 22, 2020
f89274c
Remove auth unit tests
ldclakmal Dec 23, 2020
5a003be
Initialize file user store configuration
ldclakmal Dec 27, 2020
8f040a8
Add unit tests for auth handlers
ldclakmal Dec 27, 2020
f32351e
Merge branch 'master' of https://github.com/ballerina-platform/module…
ldclakmal Jan 4, 2021
4bd08ea
Refactor code
ldclakmal Jan 5, 2021
893465d
Remove ballerina/reflect dependency
ldclakmal Jan 5, 2021
2b66be6
Add transitive dependencies
ldclakmal Jan 5, 2021
b10872e
Fix compilation errors
ldclakmal Jan 6, 2021
02de75e
Mark functions as isolated functions
ldclakmal Jan 6, 2021
21446bc
Fix auth unit tests
ldclakmal Jan 6, 2021
c6647f7
Add missing dependencies for tests
ldclakmal Jan 6, 2021
4c3523c
Rename system module dependency as os module
ldclakmal Jan 6, 2021
bb459d9
Add system dependency temporarily
ldclakmal Jan 7, 2021
1dca946
Improve auth handler unit tests
ldclakmal Jan 7, 2021
5225ec8
Add support to read scopes by custom key value
ldclakmal Jan 7, 2021
e62443a
Fix a bug
ldclakmal Jan 7, 2021
635b6ab
Add auth handler negative unit test cases
ldclakmal Jan 7, 2021
a73a6df
Remove system dependency
ldclakmal Jan 7, 2021
90dbd04
Refactor code
ldclakmal Jan 7, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 39 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,18 @@ ext.stdlibIoVersion = project.stdlibIoVersion
ext.stdlibLogVersion = project.stdlibLogVersion
ext.stdlibStringutilsVersion = project.stdlibStringutilsVersion
ext.stdlibAuthVersion = project.stdlibAuthVersion
ext.stdlibJwtVersion = project.stdlibJwtVersion
ext.stdlibOAuth2Version = project.stdlibOAuth2Version
ext.stdlibCacheVersion = project.stdlibCacheVersion
ext.stdlibTimeVersion = project.stdlibTimeVersion
ext.stdlibCryptoVersion = project.stdlibCryptoVersion
ext.stdlibFileVersion = project.stdlibFileVersion
ext.stdlibConfigVersion = project.stdlibConfigVersion
ext.stdlibReflectVersion = project.stdlibReflectVersion
ext.stdlibRuntimeVersion = project.stdlibRuntimeVersion
ext.stdlibSystemVersion = project.stdlibSystemVersion
ext.stdlibOsVersion = project.stdlibOsVersion
ext.stdlibTaskVersion = project.stdlibTaskVersion
ext.stdlibUuidVersion = project.stdlibUuidVersion
ext.stdlibEncodingVersion = project.stdlibEncodingVersion

ext.slf4jVersion = project.slf4jVersion
ext.ballerinaTomlParserVersion = project.ballerinaTomlParserVersion
Expand Down Expand Up @@ -114,6 +117,20 @@ allprojects {
password System.getenv("packagePAT")
}
}
maven {
url 'https://maven.pkg.github.com/ballerina-platform/module-ballerina-jwt'
credentials {
username System.getenv("packageUser")
password System.getenv("packagePAT")
}
}
maven {
url 'https://maven.pkg.github.com/ballerina-platform/module-ballerina-oauth2'
credentials {
username System.getenv("packageUser")
password System.getenv("packagePAT")
}
}
maven {
url 'https://maven.pkg.github.com/ballerina-platform/module-ballerina-cache'
credentials {
Expand Down Expand Up @@ -149,13 +166,6 @@ allprojects {
password System.getenv("packagePAT")
}
}
// maven {
// url 'https://maven.pkg.github.com/ballerina-platform/module-ballerina-reflect'
// credentials {
// username System.getenv("packageUser")
// password System.getenv("packagePAT")
// }
// }
maven {
url 'https://maven.pkg.github.com/ballerina-platform/module-ballerina-runtime'
credentials {
Expand All @@ -164,7 +174,7 @@ allprojects {
}
}
maven {
url 'https://maven.pkg.github.com/ballerina-platform/module-ballerina-system'
url 'https://maven.pkg.github.com/ballerina-platform/module-ballerina-os'
credentials {
username System.getenv("packageUser")
password System.getenv("packagePAT")
Expand All @@ -177,6 +187,20 @@ allprojects {
password System.getenv("packagePAT")
}
}
maven {
url 'https://maven.pkg.github.com/ballerina-platform/module-ballerina-uuid'
credentials {
username System.getenv("packageUser")
password System.getenv("packagePAT")
}
}
maven {
url 'https://maven.pkg.github.com/ballerina-platform/module-ballerina-encoding'
credentials {
username System.getenv("packageUser")
password System.getenv("packagePAT")
}
}
}
}

Expand All @@ -193,17 +217,20 @@ subprojects {
ballerinaStdLibs "org.ballerinalang:stringutils-ballerina:${stdlibStringutilsVersion}"
ballerinaStdLibs "org.ballerinalang:mime-ballerina:${stdlibMimeVersion}"
ballerinaStdLibs "org.ballerinalang:auth-ballerina:${stdlibAuthVersion}"
ballerinaStdLibs "org.ballerinalang:jwt-ballerina:${stdlibJwtVersion}"
ballerinaStdLibs "org.ballerinalang:oauth2-ballerina:${stdlibOAuth2Version}"
ballerinaStdLibs "org.ballerinalang:cache-ballerina:${stdlibCacheVersion}"
ballerinaStdLibs "org.ballerinalang:time-ballerina:${stdlibTimeVersion}"
ballerinaStdLibs "org.ballerinalang:crypto-ballerina:${stdlibCryptoVersion}"
ballerinaStdLibs "org.ballerinalang:file-ballerina:${stdlibFileVersion}"
ballerinaStdLibs "org.ballerinalang:config-ballerina:${stdlibConfigVersion}"
// ballerinaStdLibs "org.ballerinalang:reflect-ballerina:${stdlibReflectVersion}"
ballerinaStdLibs "org.ballerinalang:runtime-ballerina:${stdlibRuntimeVersion}"

// Transitive dependencies
ballerinaStdLibs "org.ballerinalang:system-ballerina:${stdlibSystemVersion}"
ballerinaStdLibs "org.ballerinalang:os-ballerina:${stdlibOsVersion}"
ballerinaStdLibs "org.ballerinalang:task-ballerina:${stdlibTaskVersion}"
ballerinaStdLibs "org.ballerinalang:uuid-ballerina:${stdlibUuidVersion}"
ballerinaStdLibs "org.ballerinalang:encoding-ballerina:${stdlibEncodingVersion}"
}
}

Expand Down
7 changes: 5 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,17 @@ testngVersion=6.14.3
stdlibIoVersion=0.5.5-SNAPSHOT
stdlibStringutilsVersion=0.5.5-SNAPSHOT
stdlibRuntimeVersion=0.5.5-SNAPSHOT
stdlibSystemVersion=0.6.5-SNAPSHOT
stdlibOsVersion=0.7.0-SNAPSHOT
stdlibTimeVersion=1.0.6-SNAPSHOT
stdlibTaskVersion=1.1.5-SNAPSHOT
stdlibConfigVersion=1.0.5-SNAPSHOT
stdlibFileVersion=0.6.3-SNAPSHOT
stdlibCryptoVersion=1.0.5-SNAPSHOT
stdlibLogVersion=1.0.5-SNAPSHOT
stdlibReflectVersion=0.5.5-SNAPSHOT
stdlibMimeVersion=1.0.5-SNAPSHOT
stdlibCacheVersion=2.0.5-SNAPSHOT
stdlibAuthVersion=1.0.5-SNAPSHOT
stdlibJwtVersion=1.0.7-SNAPSHOT
stdlibOAuth2Version=1.0.5-SNAPSHOT
stdlibUuidVersion=0.9.1-SNAPSHOT
stdlibEncodingVersion=1.0.7-SNAPSHOT
4 changes: 4 additions & 0 deletions http-ballerina-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ task updateTomlVerions {
def stdlibDependentStringutilsVersion = project.stdlibStringutilsVersion.split("-")[0]
def stdlibDependentMimeVersion = project.stdlibMimeVersion.split("-")[0]
def stdlibDependentAuthVersion = project.stdlibAuthVersion.split("-")[0]
def stdlibDependentJwtVersion = project.stdlibJwtVersion.split("-")[0]
def stdlibDependentOAuth2Version = project.stdlibOAuth2Version.split("-")[0]
def stdlibDependentFileVersion = project.stdlibFileVersion.split("-")[0]
def stdlibDependentConfigVersion = project.stdlibConfigVersion.split("-")[0]
def stdlibDependentRuntimeVersion = project.stdlibRuntimeVersion.split("-")[0]
Expand All @@ -113,6 +115,8 @@ task updateTomlVerions {
newConfig = newConfig.replace("@stdlib.stringutils.version@", stdlibDependentStringutilsVersion)
newConfig = newConfig.replace("@stdlib.mime.version@", stdlibDependentMimeVersion)
newConfig = newConfig.replace("@stdlib.auth.version@", stdlibDependentAuthVersion)
newConfig = newConfig.replace("@stdlib.jwt.version@", stdlibDependentJwtVersion)
newConfig = newConfig.replace("@stdlib.oauth2.version@", stdlibDependentOAuth2Version)
newConfig = newConfig.replace("@stdlib.file.version@", stdlibDependentFileVersion)
newConfig = newConfig.replace("@stdlib.config.version@", stdlibDependentConfigVersion)
newConfig = newConfig.replace("@stdlib.runtime.version@", stdlibDependentRuntimeVersion)
Expand Down
89 changes: 0 additions & 89 deletions http-ballerina-tests/tests/auth_basic_auth_handler_test.bal

This file was deleted.

72 changes: 0 additions & 72 deletions http-ballerina-tests/tests/auth_bearer_auth_handler_test.bal

This file was deleted.

Loading