Как исправить: AtlassianHostUser является пустым в облачном плагине Jira - PullRequest
1 голос
/ 16 мая 2019

Как исправить: AtlassianHostUser нулевой в облачном плагине Jira.

Мой контроллер выглядит так

@Controller
@IgnoreJwt
public class MainController {

private final StorageService storageService;

@Autowired
public MainController(StorageService storageService) {
    this.storageService = storageService;
}
.
.
.
@RequestMapping(value = "/upload", method = RequestMethod.POST)
public String handleFileUpload(@AuthenticationPrincipal 
AtlassianHostUser hostUser,
@RequestParam("file") MultipartFile file,
RedirectAttributes redirectAttributes) {

hostUser.getUserKey(); // Causing NPE because hostUser is null
}

Мой дескриптор показан ниже

{
"key": "copy-paste-plugin",
"baseUrl": "${addon.base-url}",
"name": "Copy Paste (Spring Boot)",
"authentication": {
    "type": "jwt"
},
"lifecycle": {
    "installed": "/installed",
    "uninstalled": "/uninstalled"
},
"scopes": [
    "READ",
    "ACT_AS_USER"
],

"modules": {
    "generalPages": [
        {
            "url": "/upload",
            "key": "upload",
            "location": "none",
            "name": {
                "value": "Attach a file"
            },
            "conditions": [
                {
                    "condition": "user_is_logged_in"
                }
            ]
        }
    ]
}
}

Это облачный плагин Jira. Я не уверен, какую часть этого мне не хватает. Нужна ваша помощь / указатель на это.

Спасибо!

...