Git Product home page Git Product logo

micronaut-core's Issues

Add HttpStatusException to control flow

Currently if you want to return a custom error status you are forced to return HttpResponse object.

We should instead add a new HttpStatusException that can be thrown.

For example:

Book save(String title) {
        if(title == null) throw new HttpStatusException(HttpStatus.UNPROCESSABLE_ENTITY, "invalid title")
}

Add ability to specify additional config file paths

We should support micronaut.config.files such that you add additional property sources via environment variables or system properties:

java -jar -Dmicronaut.config.files=file:~/myconfig.properties myjar.jar

Add support for defining configuration driven headers

It should be possible to do the following on a client:

@Header(name="Authorization", value="${some.configuration.value}"
@Client(id="blah")
interface Blah {

}

And it will add the configured header to all outgoing requests

@Replaces which does not match @Requires disables bean being replaced.

have an interface RejectionHandler

I have one singleton

@Primary
@Singleton
public class HttpStatusCodeRejectionHandler implements RejectionHandler

then I have this other bean

@Requires(property = SecuritySessionConfigurationProperties.PREFIX + ".enabled")
@Singleton
@Replaces(HttpStatusCodeRejectionHandler.class)
public class SessionSecurityfilterRejectionHandler implements RejectionHandler {

if session security is turned on. I want the next previous to be used instead.

the issue is when session security is not enabled ( the default ). No bean implemented RejectionHandler is injected in the context.

if I remove the @Replaces annotation and don't enable session security the HttpStatusCodeRejectionHandler is used as expected.

How to reproduce?

Uncomment

https://github.com/jeffbrown/micronaut-core/blob/security-jwt/security/src/main/java/io/micronaut/security/session/SessionSecurityfilterRejectionHandler.java#L40

and run tests in security module:

./graldew security:check
You will see them failing because no bean for RejectionHandler is found.

Email Notifications From Jenkins

The Jenkins instance should be configured to send email notifications for failed builds and when a broken build returns to health. The build should send email notifications to a fixed list of addresses and if do-able, notify individuals who are associated with commits related to the relevant builds.

mn -h prints info related to grails

Example:

$ mn -h

Usage (optionals marked with *):'
grails [environment]* [target] [arguments]*'

| Examples:
$ mn dev run-app
$ mn create-app books

Changing a controller routes causes Test Leakage

I have a branch for allowing configurable Security Endpoints. So that you can say /logout endpoint can be set to salir instead.

Steps to reproduce

Clone:
https://github.com/micronaut-projects/micronaut-core/tree/security-endpoints-configurable-paths

Unignore:
https://github.com/micronaut-projects/micronaut-core/blob/security-endpoints-configurable-paths/security/src/test/groovy/io/micronaut/security/endpoints/LogoutControllerPathConfigurableSpec.groovy

If you run that test in isolation you will see it passes.

If you run the whole suite the test the logout test fails in :

https://github.com/micronaut-projects/micronaut-core/blob/security-endpoints-configurable-paths/security/src/test/groovy/io/micronaut/security/events/EventListenerSpec.groovy

If you run the previous spec in isolation you will see EventListenerSpec passes.

In Suite, EventListenerSpec gets executed after LogoutControllerPathConfigurableSpec.

If you place a debug endpoint in :

https://github.com/micronaut-projects/micronaut-core/blob/security-endpoints-configurable-paths/http-server-netty/src/main/java/io/micronaut/http/server/netty/RoutingInBoundHandler.java#L222

You will see the router still contains the route /salir instead of /logout

Document Endpoints

  • 9.1 Creating Endpoints
    • General description
  • 9.1.1 The Endpoint Annotation
    • Document the available arguments
  • 9.1.2 Endpoint Methods
    • Document @Read, @Write, and @Delete annotations on endpoint methods
  • 9.1.3 Endpoint Configuration
    • Document how the prefix can change, as well as default sensitive enabled and how that plays out. Add a note about how the security project will secure sensitive endpoints.

Convert from FullNettyClientHttpResponse to NettyHttpResponse

java.lang.ClassCastException: io.micronaut.http.client.FullNettyClientHttpResponse cannot be cast to io.micronaut.http.server.netty.NettyHttpResponse

How to reproduce.

Clone:

https://github.com/jeffbrown/micronaut-core/tree/jwt

Run security sample app in examples/security.

You will need to start both gateway and security.

examples/security/gateway/src/main/java/example/gateway/Application.java

examples/security/security/src/main/groovy/example/security/SecurityApplication.java

do the next command:

curl -X "POST" "http://localhost:8080/oauth/access_token" \
     -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
     --data-urlencode "grant_type=refresh_token" \
     --data-urlencode "refresh_token=eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJldWxlciIsInJvbGVzIjpbIlJPTEVfR1JBSUxTIl0sImlhdCI6MTUyMzk1Nzk0Mn0.ChcgcPsm5Fo0DpjvnAaGrRVoM1ebZl5t8kfUXGraLHI"

Document Provided Endpoints

9.2 Built-In Endpoints

Ensure all existing endpoints are documented thoroughly including their defaults for enabled/sensitive.

Fix support for non-global status handles

The @Error annotation has a global=true flag which works for @Error(SomeException) but not for @Error(status=HttpStatus.NOT_FOUND)

Currently when defining a HTTP status error handler they are always mapped globally. The RouteBuilder interface is missing the ability to define controller specific HTTP status errors

Document Language Support

  • 8 Language Support
    • Missing a general description
  • 8.1 Micronaut for Groovy
    • Document the specific features available for Groovy users
  • 8.2 Micronaut for Kotlin
    • Add a link and a note to how to do the same thing with Maven

Router does not refresh when changing controller path via configuration property

Failing tests in sample project with Gradle while test pass with IntelliJ Junit

Clone branch `jwt´

https://github.com/jeffbrown/micronaut-core/tree/jwt

Import sample project located under examples/security.

Test pass if you execute tests in security module in IntelliJ with Junit:

napkin 8 18-04-18 2 23 51 pm

However, tests which verify a successful authentication, fail when they are run with Gradle.

example/security$ ./gradlew security:check

It seems AuthenticationProviders are not being loaded correctly in Authenticator.

See:

https://github.com/jeffbrown/micronaut-core/blob/jwt/security/src/main/java/io/micronaut/security/authentication/Authenticator.java#L44

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.