Skip to content

Commit

Permalink
SHIBUI-1807
Browse files Browse the repository at this point in the history
Added missing index field to the representation
  • Loading branch information
chasegawa committed Jun 10, 2021
1 parent 4ab559d commit f942bea
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,19 @@

import java.io.Serializable;

public class AssertionConsumerServiceRepresentation implements Serializable {
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class AssertionConsumerServiceRepresentation implements Serializable {
private static final long serialVersionUID = 7610150456756113460L;

private String locationUrl;

private String binding;

private boolean makeDefault;

public String getLocationUrl() {
return locationUrl;
}

public void setLocationUrl(String locationUrl) {
this.locationUrl = locationUrl;
}

public String getBinding() {
return binding;
}

public void setBinding(String binding) {
this.binding = binding;
}

public boolean isMakeDefault() {
return makeDefault;
}

public void setMakeDefault(boolean makeDefault) {
this.makeDefault = makeDefault;
}

private Integer index;
}
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ void setupACSs(EntityDescriptor ed, EntityDescriptorRepresentation representatio
}
assertionConsumerService.setBinding(acsRepresentation.getBinding());
assertionConsumerService.setLocation(acsRepresentation.getLocationUrl());
assertionConsumerService.setIndex(acsRepresentation.getIndex());
}
} else {
ed.getOptionalSPSSODescriptor().ifPresent(spssoDescriptor -> spssoDescriptor.getAssertionConsumerServices().clear());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -528,8 +528,8 @@ class JPAEntityDescriptorServiceImplTests extends Specification {
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
entityID="http://test.example.org/test1">
<md:SPSSODescriptor>
<md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://test.example.org/SAML/POST"/>
<md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="https://test.example.org/SAML/GET" isDefault="true"/>
<md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://test.example.org/SAML/POST" index="2"/>
<md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="https://test.example.org/SAML/GET" index="1" isDefault="true"/>
</md:SPSSODescriptor>
</md:EntityDescriptor>
'''
Expand All @@ -539,12 +539,14 @@ class JPAEntityDescriptorServiceImplTests extends Specification {
new AssertionConsumerServiceRepresentation().with {
it.binding = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST'
it.locationUrl = 'https://test.example.org/SAML/POST'
it.index = 2
it
},
new AssertionConsumerServiceRepresentation().with {
it.binding = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect'
it.locationUrl = 'https://test.example.org/SAML/GET'
it.makeDefault = true
it.index = 1
it
}
]
Expand Down

0 comments on commit f942bea

Please sign in to comment.