-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes certificate based authentication
- Loading branch information
Showing
14 changed files
with
2,362 additions
and
2,175 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...AB/app/system/+azure/+identity/@ClientCertificateCredential/ClientCertificateCredential.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
classdef ClientCertificateCredential < azure.core.credential.TokenCredential | ||
% CLIENTCERTIFICATECREDENTIAL AAD credential acquires a token with a client certificate | ||
|
||
% Copyright 2023 The MathWorks, Inc. | ||
|
||
properties | ||
end | ||
|
||
methods | ||
function obj = ClientCertificateCredential(clientCertificateCredentialj) | ||
% Created using a ClientCertificateCredential java object from the | ||
% ClientCertificateCredentialBuilder class only | ||
if isa(clientCertificateCredentialj, 'com.azure.identity.ClientCertificateCredential') | ||
obj.Handle = clientCertificateCredentialj; | ||
else | ||
logObj = Logger.getLogger(); | ||
write(logObj,'error','Expected argument of type com.azure.identity.ClientCertificateCredential'); | ||
end | ||
end | ||
end | ||
|
||
end |
26 changes: 26 additions & 0 deletions
26
...+azure/+identity/@ClientCertificateCredentialBuilder/ClientCertificateCredentialBuilder.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
classdef ClientCertificateCredentialBuilder < azure.identity.CredentialBuilderBase | ||
% CLIENTCERTIFICATECREDENTIALBUILDER Builder for ClientCertificateCredential | ||
|
||
% Copyright 2023 The MathWorks, Inc. | ||
|
||
properties | ||
end | ||
|
||
methods | ||
|
||
function obj = ClientCertificateCredentialBuilder(varargin) | ||
|
||
initialize('loggerPrefix', 'Azure:Common'); | ||
if nargin == 0 | ||
obj.Handle = com.azure.identity.ClientCertificateCredentialBuilder(); | ||
elseif nargin == 1 && isa(varargin{1}, 'com.azure.identity.ClientCertificateCredentialBuilder') | ||
obj.Handle = varargin{1}; | ||
else | ||
logObj = Logger.getLogger(); | ||
write(logObj,'error','Invalid argument(s)'); | ||
end | ||
|
||
end %function | ||
|
||
end %methods | ||
end %class |
15 changes: 15 additions & 0 deletions
15
...re/MATLAB/app/system/+azure/+identity/@ClientCertificateCredentialBuilder/authorityHost.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
function clientCertificateCredentialBuilder = authorityHost(obj, authorityHost) | ||
% AUTHORITYHOST Specifies the Azure Active Directory endpoint to acquire tokens | ||
% An updated ClientCertificateCredentialBuilder is returned. | ||
|
||
% Copyright 2023 The MathWorks, Inc. | ||
|
||
if ~(ischar(authorityHost) || isStringScalar(authorityHost)) | ||
logObj = Logger.getLogger(); | ||
write(logObj,'error','Expected argument of type character vector or scalar string'); | ||
end | ||
|
||
clientCertificateCredentialBuilderj = obj.Handle.authorityHost(authorityHost); | ||
clientCertificateCredentialBuilder = azure.identity.ClientCertificateCredentialBuilder(clientCertificateCredentialBuilderj); | ||
|
||
end |
9 changes: 9 additions & 0 deletions
9
Software/MATLAB/app/system/+azure/+identity/@ClientCertificateCredentialBuilder/build.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
function clientCertificateCredential = build(obj) | ||
% BUILD Creates new ClientCertificateCredential with the configured options set | ||
|
||
% Copyright 2023 The MathWorks, Inc. | ||
|
||
clientCertificateCredentialj = obj.Handle.build(); | ||
clientCertificateCredential = azure.identity.ClientCertificateCredential(clientCertificateCredentialj); | ||
|
||
end |
15 changes: 15 additions & 0 deletions
15
Software/MATLAB/app/system/+azure/+identity/@ClientCertificateCredentialBuilder/clientId.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
function clientCertificateCredentialBuilder = clientId(obj, clientId) | ||
% CLIENTID Sets client id | ||
% An updated ClientCertificateCredentialBuilder is returned. | ||
|
||
% Copyright 2020 The MathWorks, Inc. | ||
|
||
if ~(ischar(clientId) || isStringScalar(clientId)) | ||
logObj = Logger.getLogger(); | ||
write(logObj,'error','Expected argument of type character vector or scalar string'); | ||
end | ||
|
||
clientCertificateCredentialBuilderj = obj.Handle.clientId(clientId); | ||
clientCertificateCredentialBuilder = azure.identity.ClientCertificateCredentialBuilder(clientCertificateCredentialBuilderj); | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
Software/MATLAB/app/system/+azure/+identity/@ClientCertificateCredentialBuilder/tenantId.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
function clientCertificateCredentialBuilder = tenantId(obj, tenantId) | ||
% TENANTID Sets tenant id to authenticate through ClientCertificateCredential | ||
% An updated ClientCertificateCredentialBuilder is returned. | ||
|
||
% Copyright 2023 The MathWorks, Inc. | ||
|
||
if ~(ischar(tenantId) || isStringScalar(tenantId)) | ||
logObj = Logger.getLogger(); | ||
write(logObj,'error','Expected argument of type character vector or scalar string'); | ||
end | ||
|
||
clientCertificateCredentialBuilderj = obj.Handle.tenantId(tenantId); | ||
clientCertificateCredentialBuilder = azure.identity.ClientCertificateCredentialBuilder(clientCertificateCredentialBuilderj); | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.3.0 | ||
0.3.1 |