3434import jenkins .model .Jenkins ;
3535import org .apache .commons .lang3 .StringUtils ;
3636import org .jenkinsci .plugins .plaincredentials .StringCredentials ;
37+ import org .kohsuke .accmod .Restricted ;
38+ import org .kohsuke .accmod .restrictions .Beta ;
3739
3840/**
3941 * The implementation represents an endpoint configuration to be used in
@@ -86,6 +88,15 @@ public interface BitbucketEndpoint extends Describable<BitbucketEndpoint> {
8688 */
8789 boolean isManageHooks ();
8890
91+ /**
92+ * Sets if Jenkins is supposed to auto-manage hooks for this end-point.
93+ *
94+ * @param manageHooks if Jenkins must auto-manage hooks registration.
95+ * @param credentialsId credentialsId to use with rights to create or update web
96+ * hook for Bitbucket repositories.
97+ */
98+ void setManageHooks (boolean manageHooks , @ CheckForNull String credentialsId );
99+
89100 /**
90101 * Returns the {@link StandardUsernamePasswordCredentials#getId()} of the
91102 * credentials to use for auto-management of hooks.
@@ -106,14 +117,30 @@ public interface BitbucketEndpoint extends Describable<BitbucketEndpoint> {
106117 @ CheckForNull
107118 String getEndpointJenkinsRootURL ();
108119
120+ /**
121+ * Returns if the should or not verify incoming web hook payload from this
122+ * endpoint.
123+ *
124+ * @apiNote This method is under development so could be moved to an interface
125+ * dedicated to webhooks implementation
126+ *
127+ * @return the {@code true} if the web hook implementation configured for this
128+ * endpoint should or not verify web hook payload that could be signed
129+ * or crypted.
130+ */
131+ @ Restricted (Beta .class )
109132 boolean isEnableHookSignature ();
110133
111134 /**
112- * The {@link StringCredentials#getId()} of the credentials to use to verify
113- * the signature of hooks.
135+ * The {@link StringCredentials#getId()} of the credentials to use to verify the
136+ * signature of hooks.
137+ *
138+ * @apiNote This method is under development so could be moved to an interface
139+ * dedicated to webhooks implementation
114140 *
115141 * @return the configured credentials identifier to use
116142 */
143+ @ Restricted (Beta .class )
117144 @ CheckForNull
118145 String getHookSignatureCredentialsId ();
119146
@@ -133,10 +160,15 @@ default StandardCredentials credentials() {
133160 }
134161
135162 /**
136- * Looks up the {@link StringCredentials} to use to verify the signature of hooks.
163+ * Looks up the {@link StringCredentials} to use to verify the signature of
164+ * hooks.
165+ *
166+ * @apiNote This method is under development so could be moved to an interface
167+ * dedicated to webhook provider
137168 *
138169 * @return the credentials or {@code null}.
139170 */
171+ @ Restricted (Beta .class )
140172 @ CheckForNull
141173 default StringCredentials hookSignatureCredentials () {
142174 String credentialsId = Util .fixEmptyAndTrim (getHookSignatureCredentialsId ());
0 commit comments