Skip to content

Commit

Permalink
SIDM-4092 FR AuthTrees (#390)
Browse files Browse the repository at this point in the history
* SIDM-4092 WIP

* SIDM-4092 WIP

* SIDM-4092 WIP

* SIDM-4092 WIP

* SIDM-4092 Fix OTP max attempts issue. Remove local maven entry (for local dev).

* SIDM-4092 Post-rebase code fixes.

* SIDM-4092 Post-rebase code fixes.

* SIDM-4092 Sonar fix.
  • Loading branch information
Radoslaw Orlowski authored Jul 14, 2020
1 parent 7efc706 commit 2ccb748
Show file tree
Hide file tree
Showing 10 changed files with 493 additions and 958 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ allprojects {
sourceCompatibility = 11
targetCompatibility = 11

def idamBomVersion = '2.3.2'
def idamBomVersion = '2.3.3'

dependencyManagement {
imports {
Expand Down
261 changes: 140 additions & 121 deletions src/main/java/uk/gov/hmcts/reform/idam/web/AppController.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package uk.gov.hmcts.reform.idam.web.strategic;

import lombok.Builder;
import lombok.Data;
import org.springframework.http.HttpStatus;
import uk.gov.hmcts.reform.idam.api.internal.model.ErrorResponse;

import java.util.List;

@Data
@Builder
public class ApiAuthResult {

private List<String> cookies;
private EvaluatePoliciesAction policiesAction;
private HttpStatus httpStatus;
private ErrorResponse.CodeEnum errorCode;

public boolean isSuccess() {
return (httpStatus == HttpStatus.OK || httpStatus == HttpStatus.FOUND) &&
errorCode == null && policiesAction != EvaluatePoliciesAction.BLOCK;
}

public boolean requiresMfa() {
return policiesAction == EvaluatePoliciesAction.MFA_REQUIRED;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package uk.gov.hmcts.reform.idam.web.strategic;

public enum EvaluatePoliciesAction {
ALLOW,
BLOCK,
MFA_REQUIRED,
}

This file was deleted.

Loading

0 comments on commit 2ccb748

Please sign in to comment.