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

[CLOSES #615] Clear error msg for missing Access Annotation Entry #685

Merged
merged 1 commit into from Dec 3, 2018

Conversation

Projects
None yet
2 participants
@adrw
Member

adrw commented Dec 3, 2018

No description provided.

@adrw adrw force-pushed the adrw:adrw/20181203.615-AccessAnnotationEntryError branch from e6a0a36 to c3bd5f5 Dec 3, 2018

@adrw adrw changed the title from [CLOSES #615] Add clearer error message for missing Access Annotation… to Clear error msg for missing Access Annotation Entry Dec 3, 2018

@adrw adrw changed the title from Clear error msg for missing Access Annotation Entry to [CLOSES #615] Clear error msg for missing Access Annotation Entry Dec 3, 2018

@adrw adrw force-pushed the adrw:adrw/20181203.615-AccessAnnotationEntryError branch from c3bd5f5 to 362666b Dec 3, 2018

@@ -69,17 +69,18 @@ internal class AccessInterceptor private constructor(
requiredAnnotations += Authenticated::class
requiredAnnotations += Unauthenticated::class
requiredAnnotations += registeredEntries.map { it.annotation }
throw IllegalStateException("""AccessInterceptor A) can't find an AccessAnnotation for this WebAction or B) can't find the related AccessAnnotationEntry multibinding.
throw IllegalStateException("""You need to register an AccessAnnotationEntry to tell the authorization system which roles and services are allowed to access these actions. You can either:

This comment has been minimized.

@jjestrel

jjestrel Dec 3, 2018

Collaborator

these actions seems ambiguous here

| ${action.function.annotations}
|
| AccessAnnotationEntry Example Multibinding:
| multibind<AccessAnnotationEntry>().toInstance(
| AccessAnnotationEntry<${action.function.annotations.filter { it.annotationClass.simpleName.toString().endsWith("Access") }.firstOrNull()?.annotationClass?.simpleName ?: "{Access Annotation Class Simple Name}"}>(roles = ???, services = ???))
| AccessAnnotationEntry<${action.function.annotations.filter { it.annotationClass.simpleName.toString().endsWith("Access") }.firstOrNull()?.annotationClass?.simpleName ?: "{Access Annotation Class Simple Name}"}>(roles = listOf("eng", "???"), services = "???"))

This comment has been minimized.

@jjestrel

jjestrel Dec 3, 2018

Collaborator

How come this is (roles = listOf("eng", "???") now instead of (roles = listOf("???")?

@adrw adrw force-pushed the adrw:adrw/20181203.615-AccessAnnotationEntryError branch from 362666b to 42aec20 Dec 3, 2018

@adrw adrw force-pushed the adrw:adrw/20181203.615-AccessAnnotationEntryError branch from 42aec20 to 698be8e Dec 3, 2018

@adrw adrw merged commit c918d82 into square:master Dec 3, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment