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

Make basic auth providers isolated #209

Merged
merged 3 commits into from
May 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions auth-ballerina/client_basic_auth_provider.bal
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ public type CredentialsConfig record {|
# }
# auth:ClientBasicAuthProvider provider = new(config);
# ```
public class ClientBasicAuthProvider {
public isolated class ClientBasicAuthProvider {

CredentialsConfig credentialsConfig;
private final CredentialsConfig & readonly credentialsConfig;

# Provides authentication based on the provided Basic Auth configurations.
#
# + credentialsConfig - Credentials configuration
public isolated function init(CredentialsConfig credentialsConfig) {
self.credentialsConfig = credentialsConfig;
self.credentialsConfig = credentialsConfig.cloneReadOnly();
}

# Generates a Base64-encoded token for Basic Auth authentication.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public type FileUserStoreConfig record {|
# password = "password1"
# scopes = ["scope1", "scope2"]
# ```
public class ListenerFileUserStoreBasicAuthProvider {
public isolated class ListenerFileUserStoreBasicAuthProvider {

*ListenerBasicAuthProvider;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,18 @@ type LdapConnection record {|
# };
# auth:ListenerLdapUserStoreBasicAuthProvider provider = new(config);
# ```
public class ListenerLdapUserStoreBasicAuthProvider {
public isolated class ListenerLdapUserStoreBasicAuthProvider {

*ListenerBasicAuthProvider;

LdapConnection ldapConnection;
LdapUserStoreConfig ldapUserStoreConfig;
private final LdapConnection & readonly ldapConnection;
private final LdapUserStoreConfig & readonly ldapUserStoreConfig;

# Creates an LDAP auth store with the provided configurations.
#
# + ldapUserStoreConfig - The LDAP user store configurations
public isolated function init(LdapUserStoreConfig ldapUserStoreConfig) {
self.ldapUserStoreConfig = ldapUserStoreConfig;
self.ldapUserStoreConfig = ldapUserStoreConfig.cloneReadOnly();
LdapConnection|Error ldapConnection = initLdapConnection(self.ldapUserStoreConfig);
if (ldapConnection is LdapConnection) {
self.ldapConnection = ldapConnection;
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ slf4jVersion=1.7.30
ballerinaGradlePluginVersion=0.8.2

ballerinaLangVersion=2.0.0-beta.1-20210520-181100-6c7be323
stdlibCacheVersion=2.1.0-beta.1-20210520-211100-df32f2f
stdlibCacheVersion=2.1.0-beta.1-20210521-162000-537d4fd
stdlibCryptoVersion=1.1.0-beta.1-20210521-002900-bc269d5
stdlibLogVersion=1.1.0-beta.1-20210520-193800-22c12d0
stdlibRegexVersion=0.7.0-beta.1-20210520-193000-257850b
Expand Down