19
19
import io .micronaut .context .annotation .Requires ;
20
20
import io .micronaut .http .uri .UriBuilder ;
21
21
import org .grails .forge .api .RequestInfo ;
22
- import org .grails .forge .api .StarterConfiguration ;
22
+ import org .grails .forge .api .GrailsForgeConfiguration ;
23
23
import org .grails .forge .client .github .oauth .GitHubOAuthClient ;
24
24
import org .grails .forge .client .github .v3 .GitHubRepository ;
25
25
import jakarta .inject .Singleton ;
@@ -45,13 +45,13 @@ public class GitHubRedirectService {
45
45
private static final String AUTHORIZE_PATH = "/login/oauth/authorize" ;
46
46
47
47
private final String githubOAuthUrl ;
48
- private final StarterConfiguration starterConfiguration ;
49
- private final StarterConfiguration .GitHubConfiguration gitHubConfiguration ;
48
+ private final GrailsForgeConfiguration starterConfiguration ;
49
+ private final GrailsForgeConfiguration .GitHubConfiguration gitHubConfiguration ;
50
50
51
51
public GitHubRedirectService (
52
52
@ NotNull @ Property (name = OAUTH_URL ) String githubOAuthUrl ,
53
- @ NotNull StarterConfiguration starterConfiguration ,
54
- @ NotNull StarterConfiguration .GitHubConfiguration gitHubConfiguration ) {
53
+ @ NotNull GrailsForgeConfiguration starterConfiguration ,
54
+ @ NotNull GrailsForgeConfiguration .GitHubConfiguration gitHubConfiguration ) {
55
55
this .githubOAuthUrl = githubOAuthUrl + AUTHORIZE_PATH ;
56
56
this .starterConfiguration = starterConfiguration ;
57
57
this .gitHubConfiguration = gitHubConfiguration ;
@@ -83,16 +83,16 @@ protected URI constructOAuthRedirectUrl(RequestInfo requestInfo) {
83
83
}
84
84
85
85
/**
86
- * Creates redirect URI back to launcher app with details about created github repository in query parameters.
86
+ * Creates redirect URI back to Grails Application Forge with details about created github repository in query parameters.
87
87
*
88
- * @param gitHubRepository github repository
89
- * @return URI or null if the launcher url is missing in starter
88
+ * @param gitHubRepository GitHub Repository
89
+ * @return URI or null if the Grails Application Forge URL is missing
90
90
*/
91
- protected URI constructLauncherRedirectUrl (GitHubRepository gitHubRepository ) {
91
+ protected URI constructGrailsForgeRedirectUrl (GitHubRepository gitHubRepository ) {
92
92
URI redirectUri = getLauncherURI ();
93
93
if (redirectUri == null ) {
94
94
if (LOG .isWarnEnabled ()) {
95
- LOG .warn ("Can't construct redirect back to launcher as configuration is missing redirect uri." );
95
+ LOG .warn ("Can't construct redirect back to Grails Application Forge as configuration is missing redirect uri." );
96
96
}
97
97
return null ;
98
98
}
@@ -104,23 +104,23 @@ protected URI constructLauncherRedirectUrl(GitHubRepository gitHubRepository) {
104
104
.queryParam ("htmlUrl" , gitHubRepository .getHtmlUrl ())
105
105
.build ();
106
106
} catch (Exception e ) {
107
- String msg = "Failed to construct redirect to URI back to launcher : " + e .getMessage ();
107
+ String msg = "Failed to construct redirect to URI back to Grails Application Forge : " + e .getMessage ();
108
108
LOG .error (msg , e );
109
109
throw new RuntimeException (msg );
110
110
}
111
111
}
112
112
113
113
/**
114
- * Creates redirect URI back to launcher app with error message.
114
+ * Creates redirect URI back to Grails app forge with error message.
115
115
*
116
116
* @param error message
117
- * @return URI or null if the launcher url is missing in starter
117
+ * @return URI or null if the Grails Forge url is missing
118
118
*/
119
- protected URI constructLauncherErrorRedirectUrl (String error ) {
119
+ protected URI constructGrailsForgeErrorRedirectUrl (String error ) {
120
120
URI redirectUri = getLauncherURI ();
121
121
if (redirectUri == null ) {
122
122
if (LOG .isWarnEnabled ()) {
123
- LOG .warn ("Can't construct redirect back to launcher as configuration is missing redirect uri." );
123
+ LOG .warn ("Can't construct redirect back to Grails Application Forge as configuration is missing redirect uri." );
124
124
}
125
125
return null ;
126
126
}
@@ -130,7 +130,7 @@ protected URI constructLauncherErrorRedirectUrl(String error) {
130
130
.queryParam ("error" , error )
131
131
.build ();
132
132
} catch (Exception e ) {
133
- String msg = "Failed to construct error redirect to URI back to launcher : " + e .getMessage ();
133
+ String msg = "Failed to construct error redirect to URI back to Grails Application Forge : " + e .getMessage ();
134
134
LOG .error (msg , e );
135
135
throw new RuntimeException (msg );
136
136
}
0 commit comments