com.atlassian.connect.spring.ForgeRemote Maven / Gradle / Ivy
package com.atlassian.connect.spring;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* An annotation used on Spring Web MVC
* {@link org.springframework.stereotype.Controller}s or individual controller methods to verify that the request is
* coming from an Atlassian Forge app to this remote backend endpoint as per the
* Forge Remote contract.
* To accept requests coming from a Forge app, add this annotation to the method:
*
@Controller
* @ForgeRemote
* public class PublicController {
* ...
* }
*
* To access Connect context variables via `AtlassianHostUser`, use the following annotation in the method:
* @ForgeRemote(associateConnect=true)
* public class PublicController {
* ...
* }
*
*/
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface ForgeRemote {
boolean associateConnect() default false;
}