Examples of CredentialNotFoundException


Examples of javax.security.auth.login.CredentialNotFoundException

     @since 0.30
     */
    public synchronized void protect(String page, HashMap<String, Object> protectionstate, String reason) throws IOException, LoginException
    {
        if (user == null || !user.isAllowedTo("protect"))
            throw new CredentialNotFoundException("Cannot protect: permission denied.");

        long start = System.currentTimeMillis();
        HashMap info = getPageInfo(page);
        String protectToken = (String)info.get("token");

View Full Code Here

Examples of javax.security.auth.login.CredentialNotFoundException

     */
    public synchronized void rollback(Revision revision, boolean bot, String reason) throws IOException, LoginException
    {
        // check rights
        if (user == null || !user.isAllowedTo("rollback"))
            throw new CredentialNotFoundException("Permission denied: cannot rollback.");

        // check whether we are "on top".
        Revision top = getTopRevision(revision.getPage());
        if (!top.equals(revision))
        {
View Full Code Here

Examples of javax.security.auth.login.CredentialNotFoundException

            Revision[] revisions) throws IOException, LoginException
            {
        long start = System.currentTimeMillis();

        if (user == null || !user.isAllowedTo("deleterevision") || !user.isAllowedTo("deletelogentry"))
            throw new CredentialNotFoundException("Permission denied: cannot revision delete.");

        String deltoken = (String)getPageInfo(revisions[0].getPage()).get("token");

        StringBuilder out = new StringBuilder("reason=");
        out.append(URLEncoder.encode(reason, "UTF-8"));
View Full Code Here

Examples of javax.security.auth.login.CredentialNotFoundException

        long start = System.currentTimeMillis();

        // check for log in
        if (user == null || !user.isAllowedTo("upload"))
        {
            CredentialNotFoundException ex = new CredentialNotFoundException("Permission denied: cannot upload files.");
            log(Level.SEVERE, "upload", "Cannot upload - permission denied." + ex);
            throw ex;
        }
        filename = filename.replaceFirst("^(File|Image|" + namespaceIdentifier(FILE_NAMESPACE) + "):", "");
View Full Code Here

Examples of javax.security.auth.login.CredentialNotFoundException

    {
        long start = System.currentTimeMillis();

        // check if blocked, logged in
        if (this.user == null || !this.user.isAllowedTo("sendemail"))
            throw new CredentialNotFoundException("Permission denied: cannot email.");

        // is this user emailable?
        if (!(Boolean)user.getUserInfo().get("emailable"))
        {
            // should throw an exception here
View Full Code Here

Examples of javax.security.auth.login.CredentialNotFoundException

     */
    public String[] getRawWatchlist(boolean cache) throws IOException, CredentialNotFoundException
    {
        // filter anons
        if (user == null)
            throw new CredentialNotFoundException("The watchlist is available for registered users only.");

        // cache
        if (watchlist != null && cache)
            return watchlist.toArray(new String[watchlist.size()]);

View Full Code Here

Examples of javax.security.auth.login.CredentialNotFoundException

     @since 0.27
     */
    public Revision[] watchlist(boolean allrev, int... ns) throws IOException, CredentialNotFoundException
    {
        if (user == null)
            throw new CredentialNotFoundException("Not logged in");
        StringBuilder url = new StringBuilder(query);
        url.append("list=watchlist&wlprop=ids%7Ctitle%7Ctimestamp%7Cuser%7Ccomment%7Csizes&wllimit=max");
        if (allrev)
            url.append("&wlallrev=true");
        constructNamespaceString(url, "wl", ns);
View Full Code Here

Examples of javax.security.auth.login.CredentialNotFoundException

     @since 0.28
     */
    public String[] queryPage(String page) throws IOException, CredentialNotFoundException
    {
        if (page.equals("Unwatchedpages") && (user == null || !user.isAllowedTo("unwatchedpages")))
            throw new CredentialNotFoundException("User does not have the \"unwatchedpages\" permission.");

        String url = query + "action=query&list=querypage&qplimit=max&qppage=" + page + "&qpcontinue=";
        String offset = "";
        ArrayList<String> pages = new ArrayList<String>(1333);

View Full Code Here

Examples of javax.security.auth.login.CredentialNotFoundException

            throw new AssertionError("Bot privileges missing or revoked, or session expired.");
        if ((assertion & ASSERT_USER) == ASSERT_USER && line.contains("error code=\"assertuserfailed\""))
            // assert !line.contains("error code=\"assertuserfailed\"") : "Session expired.";
            throw new AssertionError("Session expired.");
        if (line.contains("error code=\"permissiondenied\""))
            throw new CredentialNotFoundException("Permission denied."); // session expired or stupidity
        // rate limit (automatic retry), though might be a long one (e.g. email)
        if (line.contains("error code=\"ratelimited\""))
        {
            log(Level.WARNING, caller, "Server-side throttle hit.");
            throw new HttpRetryException("Action throttled.", 503);
View Full Code Here

Examples of javax.security.auth.login.CredentialNotFoundException

            throw new LoginException("No Tomcat realm available");
        }

        final Principal principal = realm.authenticate(username, password);
        if (principal == null) {
            throw new CredentialNotFoundException(username);
        }

        final Subject subject = createSubject(realm, principal);
        return registerSubject(subject);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.