Skip to content

adding interfaces for public api#39

Merged
SomkaPe merged 5 commits intodevfrom
somkape/apiUpdate
May 23, 2019
Merged

adding interfaces for public api#39
SomkaPe merged 5 commits intodevfrom
somkape/apiUpdate

Conversation

@SomkaPe
Copy link
Copy Markdown
Contributor

@SomkaPe SomkaPe commented May 16, 2019

No description provided.

@SomkaPe SomkaPe requested review from henrik-me and sangonzal May 16, 2019 22:10
Copy link
Copy Markdown
Contributor

@sangonzal sangonzal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed other questions offline. :shipit:

build();

AuthenticationResult result = cca.acquireToken(ClientCredentialParameters
AuthenticationResult result = (AuthenticationResult)cca.acquireToken(ClientCredentialParameters
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IAuthenticationResult instead of casting for consistency ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will change

build();

AuthenticationResult result = pca.acquireToken(UserNamePasswordParameters
AuthenticationResult result = (AuthenticationResult)pca.acquireToken(UserNamePasswordParameters
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok


Assert.assertNotNull(result);
Assert.assertNotNull(result.accessToken());
Assert.assertNotNull(result.refreshToken());
Copy link
Copy Markdown
Contributor

@henrik-me henrik-me May 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assert.assertNotNull(result.refreshToken()); [](start = 8, length = 44)

Assuming for ROPC where we don't get the RT, however what changed other places made the RT be null now?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we do not expose RT through IAuthenticationResult


Assert.assertNotNull(result);
Assert.assertNotNull(result.accessToken());
Assert.assertNotNull(result.refreshToken());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assert.assertNotNull(result.refreshToken()); [](start = 8, length = 44)

Why?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we do not expose RT through IAuthenticationResult

account.clientInfo().toAccountIdentifier());
account.environment(environment);
@AllArgsConstructor
public class Account implements IAccount {
Copy link
Copy Markdown
Contributor

@henrik-me henrik-me May 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Account [](start = 13, length = 7)

what happened to the other fields on account? not sure I understand why those are only for the cache entity

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change was to separate Account cache entity from IAccount - part of public api

@Getter
@Setter
@EqualsAndHashCode
class AccountCacheEntity {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this implement IAccount ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change was to separate Account cache entity from IAccount - part of public api

@henrik-me
Copy link
Copy Markdown
Contributor

henrik-me commented May 17, 2019

a number of field/class comments has been removed. How are the api docs created?
Will the comments automatically be available on the classes based on the comments in the interface?

package com.microsoft.aad.msal4j;

public interface ITokenCache {
void deserializeAndLoadToCache(String data);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps just deserialize or load? And add a comment to clarify what actually happens?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may be ... ok will rename

public interface ITokenCache {
void deserializeAndLoadToCache(String data);

String serialize();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

@@ -25,8 +25,8 @@

public interface ITokenCacheAccessAspect {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comments?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added


IAccount getAccount();

boolean isCacheChanged();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is [](start = 12, length = 2)

nit: understand why you call this is ... perhaps has?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, will rename


IAccount getAccount();

boolean isCacheChanged();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comments?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added


public static String INSTANCE_DISCOVERY_RESPONSE = "{" +
"\"tenant_discovery_endpoint\":\"https://login.microsoftonline.com/organizations/v2.0/.well-known/openid-configuration\"," +
"\"tenant_discovery_endpoint\":\"https://login.microsoftonline.com/organizations/v2.0/.well-known/openid-appConfiguration\"," +
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

app [](start = 117, length = 3)

why adding app?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will fix - side effect of refactoring with IDE


public interface IAccount {

String homeAccountId();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding comments to public interfaces

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

/**
* Represents the results of token acquisition operation.
*/
public interface IAuthenticationResult {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding comments to public interfaces

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

@SomkaPe
Copy link
Copy Markdown
Contributor Author

SomkaPe commented May 23, 2019

a number of field/class comments has been removed. How are the api docs created?
Will the comments automatically be available on the classes based on the comments in the interface?

@henrik-me Yes, comments are inherited from interfaces

@SomkaPe SomkaPe merged commit bcf5d5d into dev May 23, 2019
@SomkaPe SomkaPe deleted the somkape/apiUpdate branch June 6, 2019 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants